Version 3 of Possible Grid Enhancements

Updated 2008-01-13 15:38:38 by spjuth

Peter Spjuth 2004-01-12 : This page is for collecting and discussing ideas about improving the grid geometry manager.

If you who feel that anything here is a really good idea you are encouraged to write a TIP for it.

Previous TIPs about grid are 37 [L1 ], 146 [L2 ] and 147 [L3 ].


Weight on a slave

This is a shortcut for a rather common grid case. To make a widget fill up its space becomes a one-liner.

 frame .f
 text .f.t
 grid .f.t -sticky news -weight 1

If a slave has both "n" and "s" in its -sticky, its -weight is transferred to the row(s) it occupies.

If a slave has both "w" and "e" in its -sticky, its -weight is transferred to the column(s) it occupies.

If different slaves or a row/columnconfigure want to set contradicting weights (not counting 0), this is an error.


Setting up slave defaults in a master

 grid slavedefaults .f -padx 2 -pady 2 -sticky news

Affects any slaves added to that master in the future.

Maybe even:

 grid slavedefaults all -padx 2 -pady 2 -sticky news

Scrolled grid

 frame .f
 scrollbar .sbx -command "grid xview .f"
 scrollbar .sby -command "grid yview .f"
 grid masterconfigure .f -xscrollcommand ".sbx set" -yscrollcommand ".sby set"

This becomes a way to do a scrolled frame without the frame-in-canvas trick.

Experimental patch for this at [L4 ]


Epsilon weight

Allow an "epsilon" value for -weight that is larger than any zero and smaller than any other value. Currently weights that differ a lot like "1" and "100000" can be used to get this effect but that is a bit ugly.

If weights were floats could help too.

Another possibility would be to allow different weights for different situations, like initial layout, shrinking and growing.