TIP #177 Version 1.1: Add -stretch Option to Panedwindow

This is not necessarily the current version of this TIP.


TIP:177
Title:Add -stretch Option to Panedwindow
Version:$Revision: 1.1 $
Author:Brian Griffin <bgriffin at model dot com>
State:Draft
Type:Project
Tcl-Version:8.5
Vote:Pending
Created:Wednesday, 17 March 2004
Keywords:Tk

Abstract

This TIP proposes adding a paneconfigure option to [panedwindow]s that will allow alternative fill behavior.

Rationale

The current behavior, although reasonable, is too limiting.

Proposed Change

Currently, the panedwindow widget gives any remaining space (or takes away space) from the last (right most or bottom most) pane only. This proposal will add a per pane configure option so that any or all panes may receive the additional space.

A -stretch option will be added to the paneconfigure list of options. The value will be an enumeration of "last", "first", "middle", "always", and "never". The default value will be "last" which maintains the panedwindow's current behavior. The panedwindow will calculate the required size of all its panes. Any remaining (or deficit) space will be distributed to those panes marked for stretching. The space will be distributed based on each panes current ratio of the whole. For example, given panes a, b, and c, where only b and c are marked for stretching and b's size is 25% of (b+c) size, then b will receive 25% of the surplus or deficit space. The -stretch enumerations have the following behaviors:

last

Only if this pane is the last (right-most or bottom-most, depending on overall orientation) pane will it stretch.

first

Only if this pane is the first (left-most or top-most, depending on overall orientation) pane will it be stretch.

middle

Only if this pane is not the first or last pane will it stretch.

always

This pane will always stretch.

never

This pane will never stretch.

Draft Implmentation

An implementation of this enhancement is availble [1].

Copyright

This document has been placed in the public domain.


Powered by TclThis is not necessarily the current version of this TIP.

TIP AutoGenerator - written by Donal K. Fellows