TIP #177: Add -stretch Option to panedwindow Widget


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

Abstract

This TIP proposes adding a paneconfigure option to panedwindows that will allow alternative fill behavior.

Rationale

The current behavior, although reasonable, is too limiting. We should give control to programmers so that they can specify the fill behavior in a way that makes sense for their application.

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 is 25% of the size of (b+c), then b will receive 25% of the surplus or deficit space.

The -stretch enumeration values have the following meaning:

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 Tcl[Index] [History] [HTML Format] [Source Format] [LaTeX Format] [Text Format] [XML Format] [*roff Format (experimental)] [RTF Format (experimental)]

TIP AutoGenerator - written by Donal K. Fellows