Version 10 of Pave, sort of geometry manager

Updated 2019-07-17 10:43:20 by aplsimple

The pave software provides a sort of geometry management for Tcl/Tk.

The pave isn't designed to replace the existing Tk geometry managers (Tk GMs). Rather it tries to simplify the window layout by using their best.

The Tk GMs have the following drawbacks:

  • The place is good when you need e.g. the overlapping popup messages. Still it is rarely used because of its complexity esp. when you need a resizable window of multiple widgets.
  • The pack is very good for simple layouts. But if your layout is growing in contents and complexity, its packs start being more and more tricky, sometimes even mystic.
  • The grid is best of all. However it is tiresome and tricky at the modifications of existing layouts. The inserting/removing a cell can become a real torment with those recalculations of cells/rows and sticky/weight attributes. The usage of relative (- x ^) grid is restricted with simple layouts of table type.

All of the Tk GMs have the common drawback consisting in that the widgets' creation, configuration and layout are separated in space and time. In practice it means that to modify the layout you need look at the 2-3-4.. places of your code, namely the widgets creation / configuration / geometry management. You are happy if those separated places are spanned by your editor's screen.

The proposed pave allows you to get rid of these drawbacks by means of:

  • uniting the creation of widgets (and mostly their configuration) with their layout
  • minimizing a coder's efforts at inserting/removing and naming/accessing widgets
  • using a batch of 'mega-widgets'
  • joining the power of grid and pack

The pave is implemented as PaveMe oo::class, so that you can enhance it with your own inherited class.

Also, you can employ PaveDialog oo::class and PaveInput oo::class that allow you:

  • to call the standard dialogs with a checkbox of "Don't show again" type
  • to call the standard dialogs with tagged text
  • to call the input dialog using entry, combobox, text, spinbox, checkbutton, radiobutton, file / directory / color / font / date pickers
  • to use menubar, toolbar, statusbar and the mentioned pickers as 'mega-widgets'
  • to resize windows neatly (however strange, not done in Tk standard dialogs)

The theming facility of pave is enabled by ObjectTheming oo::class which embraces ttk as well as non-ttk widgets. This is seen on the demo video .

Further details:

https://aplsimple.bitbucket.io/en/tcl/pave

Download link:

https://aplsimple.bitbucket.io/bin/pave.rar

Demo video (6.3 Mb) link:

https://aplsimple.bitbucket.io/files/test2pave.mp4

Below are some few PaveMe, PaveDialog, PaveInput and ObjectTheming demo screenshots, just to give a glance at this stuff.

PaveMe example

Figure 1. PaveMe example described line by line in https://aplsimple.bitbucket.io/en/tcl/pave/index.html#example_Pave

Common PaveDialog instance

Figure 2. Common PaveDialog instance.

Tagged text instance of PaveDialog

Figure 3. Tagged text PaveDialog instance.

Input instance of PaveDialog

Figure 4. PaveInput instance.

test2_pave.tcl demo

Figure 5. Screenshot of test2_pave.tcl.

test2_pave.tcl demo themed

Figure 6. The same as above, just themed.