Paver, textual GUI builder

Paver is a sort of GUI builder incorporated into alited editor.

It allows viewing a GUI layout and modifying it in a textual mode on fly. They say, the textual mode is preferred by Unix. Probably, by Tcl too :)

The use of paver is rather simple: the cursor is set on a currently edited layout (widget list in terms of apave package) and Paver tool is called.

First, paver strips the layout of variables / commands used (as it knows nothing about them). Then the stripped layout is displayed as a toplevel window. The edited script isn't touched by paver.

So, paver displays only a pure layout without any functionality that depends naturally on a real employment of the layout.

There is Auto Update mode which means that paver will update a currently edited layout after each saving its script to the disk, so that a user can view the layout on fly. At need, a user can view / modify the stripped code of the layout, to play with it separately.

Demo

To see how this works, two demos are available:

Other implementations

The idea can be implemented in any Tcl/Tk editor with an appropriate plugin, even in several ways:

  • GUI layouts might be separated into procedures or methods so that a user sets a cursor on a proc / method body and calls the plugin
  • GUI layouts might be separated into sourced files to be handled by the plugin
  • GUI layouts might be edged with special comments so that a user sets a cursor somewhere between them and calls the plugin (e.g. paver allows using optional #paver comments to do this)

For such plugins, the layouts need not use apave package: the standard Tk commands would be enough.

Just in the case of alited, these three are integrated: alited, apave and paver.

Restrictions

Of course, there may be layouts that can't be displayed in the stripped mode, due to disabled references to variables / commands containing vital options for the GUI.

But such cases are rather rare, e.g. alited's code contains only 3 of the non-pavered layouts (with the layouts' total about 30), at that one of them is pavered after little commenting out, as the demo shows.