Tcl/Tk Workshop `95 - Thursday: Session 2

Table Layout Editor - George Howlett

Presented by George Howlett

Running Ted (Table Editor) generates a grid based on an existing display. This grid indicates padding, span, and other layout options. The grid can then be interactively manipulated. The contents of the grid are the real widgets, which gives a good feel for how the application will look. Cut and Paste and Drag&Drop can be used to manipulate parts of the layout, as can property sheets (such as for centering choices). Ted outputs Tcl code that describes the layout into a separate file. George discused some of the implementations issues, such as early attempts based on the canvas. Notice that Ted doesn't attempt to be a full GUI builder (yet). GUI builders face a lot of complex issues, such as dealing with the behavior and callbacks of complex sub-widgets. Ted instead focuses on editing existing applications.

Mega-widgets in Tcl/Tk - Shannon Jaeger

Presented by Shannon Jaeger

Shannon developed a framework for evaluating mega-widgets, which she then used to evaluate six different mega-widget extensions. A mega-widget is defined as "a collection of primitive widgets". A mega-widget extenion is defined as "an application that extends the functionality of Tcl/Tk...". Mega-widgets should look like traditional Tk widgets to the application builder: it should provide a creation command, widget command, configure options, widget suboptions, and possibly widget component access. The widget builder needs support from the mega-widget extension for implementing the creation command, widget command, parsing, and default behavior. The widget builder would also like subcommand support: creating new subcommands and re-using existing subcommands, in addition to parsing and namespace/scoping issues. Additionally, the widget builder needs configuraiton option support: creation of new ones, define handlers, re-use, parsing, and a rich model of propagation to sub-components.

[incr Tcl], Wigwam, [incr Tk], Tix, TkMegaWidget, and theObjects were investigated. These packages tended to trade-off Housekeeping vs. Flexibility; you tended to get either one or the other. All were weak on the component access and supporting Tk commands such as winfo children.

Designing Mega Widgets in the Tix Library - Ioi K. Lam

Presented by Ioi K. Lam

The Tix Library includes a set of mega-widgets such as combo-boxes, file-browsers, and a notebook widget for creating compact interfaces. Ioi was quite enamored with the visual style of these widgets -- "a prettier UNIX!" Tix simplifies and reducess the amount of Tcl code necessary for creating these sorts of widgets. The principles of Tix are: "easy to learn and use, hide details, safe way to access component widgets." Tix supports the Tk API, as discussed in the Jaeger paper. Ioi pointed out that the standard Tk widgets do not provide a consistent style for retrieving user input: sometimes widget components, sometimes commands, etc. Tix provides five options: -value, -variable, -command (called after -value changes), -validatecmd (called before -value changes), and -browsecmd (called on temporary inputs). Many Tix applications find that use of -command and -browsecmd obviates the need for most bindings. Ioi concluded by mentioning that the new version of Tix will address most of the weaknesses pointed out in the Jaeger analysis (and Ioi feels the rest aren't very important...). Questions brought out that the mega-widget facilities will need to address cross-platform issues as Tcl/Tk appear on Windows and Macintosh.

Available from here.

[incr Widgets] An Object-Oriented Mega-Widget Set - Mark L. Ulferts

Presented by Mark L. Ulferts

Mark felt that mega-widgets do a lot to simplify GUI programming by reducing the amount of code that has to be written and by providing higher level building blocks. Mega-widgets also support a consistent GUI style, helping the developer avoid the "angry fruit salad" application that uses a seemingly random visual style. [incr Widgets] is based on [incr Tcl] 2.0 and [incr Tk] 1.0 (no C code) and can be extended either through inheritance or composition. [incr Widgets] has a broad gallery of widgets, which closely support the Motif look and feel. These widgets support dynamic configuration, much like the standard Tk widgets; configuration extends down to the sub-components. [incr widgets] also uses the Motif concept of child sites to support embedded composition of other widgets, including dynamic management of child site layout. Mark presented an excellent example based on the realtionship between Sun's stock price and the beta-releases of Tk4.0. This will be incorporated into the the "incr distribution" and should be available in late summer. See "http://www.wn.com" for more information.