Table of Contents
The conventional way in Graphical User Interface-frameworks is to let the parent windows manage their children. This is mostly the same with Tcl/Tk, but geometry management is delegated to a dedicated manager.
The geometry manager is responsible to arrange its clients according to customization and built-in rules.
There are geometry manager which can cooperate –that is ignore each other–, while others will run amok. The »grid« and »pack« geometry managers feature size propagation . A managed window will claim the required size from its managing window and thus propagate its size up through the window hierarchy. Only a single geometry manager may use propagation in one region.
Jeszra supports more than 15 different Tcl/Tk geometry managers.
Supported General Geometry Managers
grid: This is the most important general purpose geometry manager. Jeszra's ratio is roughly 4x grid: 1x place: 1x pack.
When Gstripes is used the ratio growth massive in favor for place. The Gstripes window is always managed via place; preventing any propagation mishap.
table: from BLT is one of grid’s predecessors.
place: Allows simple relative and absolute coordinate placement inside a region.
The place manager is very similar to the geometry management in other frameworks.
pack: The historic geometry manager of Tcl/Tk. pack is very simple to use –at least for ragged designs. Pack is non-commutative so better avoid it for dynamic designs.
Since pack was the single most used geometry manager in Tcl/Tk, before grid was incorporated into the toolkit, there are still a series of window properties to support designs based on pack: »anchor«, »padx« and »pady« for example. These properties are no longer necessary, just use the grid manager.
tixform: from the Tix package.
Other geometry managers are part of specific window classes: WM is built into menus and toplevel, text in text windows, htext in BLT htext windows, table in tktable table window, canvas in canvas and pathCanvas windows, zincwindow in zinc windows, paned in paned windows, and almost every tabset or notebook window features its own geometry manager, too.
Window specific geometry managers are usually named indentical to the window class, but starting with a lower case character. Exceptions from this informal rule are »PathCanvas« which uses canvas and »Zinc« with zincwindow.
Unfortunately, the TkTable’s built-in geometry manager follows the informal naming convention. Hence there are two »table« geometry managers. A general purpose geometry manager »table« from BLT and a built-in geometry manager inside the table window.
The most important embedded geometry managers are the drawing windows TkZinc 3.3.4, canvas and text, htext. TkZinc 3.3.4 and canvas geometry managers behave similar to place. They also provide the ability to scroll content, which is an important feature for very big Graphical User Interfaces.
The text based geometry managers feature a float-like design. Embedded windows are treated as glyphs.
This chapter is abridged. The full text is available in printed form or as a PDF from: www.lulu.com.