The Tile window commands are identical named to their Tk counterparts.
The two buttons in Example 7.11, “button versus tk::button”, are both created by »tk::button«. The first form only deploys the imported form.
Using a theming engine under AQUA® is a design blooper.
Most AQUA® users do not tolerate alternative "themed" Graphical User Interfaces. Better hide the fact that your Graphical User Interface uses a theming engine under AQUA®.
Tile is incompatible to the dominant KDE and gnome desktop environments under X Window System. Theme changes in these environments are not reflected in a Tile based application.
Not every Tk window has a Tile counterpart. Toplevel and menus are not themed. The KDE and gnome themes usually modify the X Resource Database. The X Resource Database is utilized by Tcl/Tk, but almost always ignored in themes. Changing the theme under KDE or gnome may destroy the visual integration of Tile and Tk windows.
Table 7.1. Ttk versus Tk Button Properties
Ttk | Tk |
---|---|
style | background |
padding | foreground |
activeForeground | |
activeBackground | |
font | |
height | |
padX | |
padY | |
borderWidth | |
relief | |
overRelief | |
repeatDelay | |
repeatIntervall | |
anchor | |
justify | |
bitmap | |
highlightThickness | |
highlightBackground | |
highlightColor |
A Tcl/Tk application, capable to deploy Tile or plain Tk must store every property, were Tk and Ttk differ, inside the Option Database. Jeszra provides a Tile dedicated resource set, listing these properties: (Figure 7.1, “Preferences: Option DB” ).
Unknown or erroneous Option Database properties are gracefully ignored by every window unaware of it.
The template is tied to a specific window type for each specific property, either from Tile such as style or Tk such as background, when the property is published in the template interface.
The obvious solution, to avoid a broken interface, as in Example 7.13, “Published Background”, is to not include these properties in the template interface. There is a better solution available. The Runtime Library template mechanism does detect when an broken interface property is encountered and ignores the errors stemming from it. This workaround addresses the writing to properties.
Reading from the template interface requires a more sophisticated approach. The underlying technique is called inoculation. I described the inoculation technique in: Runtime Library themed ff. After inoculating a template interface, the contained windows, partake on theme changes. These theme changes are pipelined through the template interface, from which it is distributed to its elements. Even plain Tk windows are thus theme able. The template doesn’t even need a single Tile element for using themes!
Tile isn’t used by Jeszra, hence there is no default palette dedicated to Tile.
Any Tile window is by definition a black box for the code generation. Scalable Vector Graphics generation requires a high degree of introspection. This is technically denied by any theming engine, and here in particular Tile. It is not possible to generate Scalable Vector Graphics from a Tile window.
A workaround however is possible. In this situation a screen-shot is made from the Tile window and the created image embedded into the generated Scalable Vector Graphics. Tk lacks the ability to take such screen-shot. There are however some packages with the capacity to generate the required screen shots: »Img« and »Pixane« for example.
The Scalable Vector Graphics code generation is already prepared to use »Img« for such screen shots.
The Figure 7.6, “Substitution Preferences” displays a mapping table for certain window classes. The first column in »Substitute with« shows the assumed creator for a certain window class, and second what must be used instead. All Tile window classes are listed here. The mapping includes the Tile namespace »ttk«. For windows fo class »TMenubutton« »ttk::menubutton« is being used.
Other window classes are listed as well. A hugelist window, for example, is created through the command »hugelist::create«.
Substitutions may occur for any window class. The pair »Button tk::button«, for example adds the namespace »tk« to each button creation code. Resembling the second case in Example 7.11, “button versus tk::button”.