Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
The Tk widgets were chosen for Glish because they have been extensively used and are robust in an interpretive environment. It is very important that widgets which are used interactively handle bad input with grace. Tk is somewhat unique in this respect. Most widget toolkits are designed to be used as linkable libraries and are therefore intended for programmers rather than end users. As a result, these library toolkits have not tended to be very robust.
In creating Glish/Tk, every attempt was made to fully integrate the widgets into Glish, and as a result, it is not simply a binding of the Tk widgets to yet another language. In Glish/Tk, the widgets are synonymous with Glish clients. They are agents which you create with functions. Once created, these agents generate and respond to events. The events which they generate are almost always the result of user interaction with the widgets. The events generated by the Tk agents are handled just like any other events in Glish.
To use this client, you should be able to simply add -l glishtk.g to the command line invocation of Glish. This will start the client which serves up the widgets, and it will define all of the necessary functions.
While Glish/Tk is quite usable, it is not yet complete, and as a result, not all of the features found in TCL/Tk have made it into Glish/Tk. In addition, this chapter only gives an introduction to Tk. For more information about Tk, I would recommend ``Practical Programming in TCL and Tk'' 11.1.
For most of the Tk widgets, a table is provided listing the events the widget accepts or generates. Table 11.1 presents the meaning behind the arrows in these tables. These arrows provide a shorthand notation for indicating event flow between Glish and the widget.
|
The default focus model for Glish/Tk is ``focus follows mouse''. The focus is always on the widget under the cursor. This is unlike the default TCL/Tk focus model, ``click to focus.'' Applications can change the focus model back to TCL/Tk's ``click to focus'' by setting:
system.tk := [=] system.tk.focus := 'click'before including glishtk.g.