Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
The information about which version of Tk is currently being used can be obtained from the system record, e.g. :
print "tk version:", system.tk.version, system.tk.version::, system.tk.version::tcl::prints something like:
tk version: 8.0 [patch=8.0p2, tcl=8.0] [patch=8.0p2]
Finally, there are a couple of utility functions you might find useful.
You can use have_gui to check if a graphical output device is available. It returns T if such a device is available and the Tk widgets can be used. Otherwise, it returns F.
Typically, tk_hold and tk_release are not needed, but sometimes when a large number of widget creation/deletion operations are done, the GUI may go through contortions. This is due to intermediate operations being processed and reflected in the GUI before the group of operations has finished. Therefore, tk_hold and tk_release can often be used to take care of this problem. A call to tk_hold prevents any Tk operations from being processed until tk_release is called.
It is important that calls to tk_hold be balanced with an equal number of calls to tk_release. Otherwise, the GUI can freeze preventing any further interaction.