| [ Team LiB ] |
|
The tk CommandThe tk command provides a few miscellaneous entry points into the Tk library. The appname operation is used to set or query the application name used with the Tk send command. If you define a new name and it is already in use by another application, (perhaps another instance of yourself), then a number is appended to the name (e.g., #2, #3, and so on). This is the syntax of the command: tk appname ?name? Fonts, canvas items, and widget sizes use screen units that are pixels, points, centimeters, millimeters, or inches. There are 72 points per inch. The tk scaling command, which was added in Tk 8.0, is used to set or query the mapping between pixels and points. A scale of 1.0 results in 72 pixels per inch. A scale of 1.25 results in 90 pixels per inch. This gives accurate sizes on a 90 dpi screen or it makes everything 25% larger on a 72 dpi screen. Changing the scale only affects widgets created after the change. This is the syntax of the command: tk scaling ?num? The tk windowingsystem command, added in Tk 8.4, returns one of x11 (X11-based), win32 (MS Windows), classic (Mac OS Classic), or aqua (Mac OS X Aqua). Traditionally, Tk applications that included platform-dependent code could simply switch on the value of the global tcl_platform(platform) element, which is set to macintosh, unix, or windows. But the introduction of Apple's OS X and the Aqua interface complicated matters. Mac OS X reports unix in the tcl_platform(platform) element. But its windowing system is not a native X Windows system, so you must use tk windowingsystem. The caret operation, introduced in Tk 8.4, sets and queries the caret location for the display of the specified Tk window. The caret is the per-display cursor location used for indicating global focus (for example, to comply with Microsoft Accessibility guidelines), as well as for location of the over-the-spot XIM (X Input Methods) or Windows IME windows. The useinputmethods operation changes the behavior of Tk on X with X Input Methods (XIM). Before Tk 8.3, XIM was recognized and used without question. As of Tk 8.3, they are recognized and initialized, but not used unless XIM is turned on with the useinputmethods operation: tk useinputmethods 1 Table 44-12 summarizes the tk command operations:
|
| [ Team LiB ] |
|