tk
Gives and sets facts of the app: its name, its scale, its windowing system, and the state of the input.
tk SUBCOMMAND ?ARG ...?
Description
The subcommands of tk work on the app as a whole. Some give facts of the platform, such as tk windowingsystem and tk touchscreen. Others keep a state for the scripts of Tk, such as tk busy and tk caret, with less effect in ztk than in Tk. The page of each subcommand says what has an effect.
tk appdata, tk insets, and tk touchscreen are subcommands of ztk for apps on phones and other platforms. Tk 8.6.16 does not have them.
A short form of a subcommand works when it matches one subcommand only, such as tk appn for tk appname. tk app is an error, because it matches appdata and appname.
Subcommands
| Subcommand | Description |
|---|---|
tk appname | Gives or sets the name of the app. |
tk scaling | Gives or sets the count of pixels in one point. |
tk windowingsystem | Gives the name of the windowing system of the app. |
tk appdata | Gives the folder of the platform for the data of the app. |
tk insets | Gives the parts of a toplevel under the bars of the system and the soft keyboard. |
tk touchscreen | Tells if the backend has a touch screen. |
tk busy | Marks a window as busy, and gives the busy windows. |
tk caret | Gives or sets the place of the text cursor of a window, for the input methods and the screen readers. |
tk fontchooser | Shows the font dialog of the platform, and keeps its options. |
tk inactive | Gives the time since the last input of the user. |
tk useinputmethods | Gives or sets a flag for the use of input methods. |
Examples
% expr {[tk windowingsystem] in {x11 win32 aqua}}
1
Errors
% tk
wrong # args: should be "tk subcommand ?arg ...?"
-errorcode TCL WRONGARGS
% tk print .
unknown or ambiguous subcommand "print": must be appdata, appname, busy, caret, fontchooser, inactive, insets, scaling, touchscreen, useinputmethods, or windowingsystem
-errorcode NONE
Differences from Tcl
tk print,tk sysnotify, andtk systrayof Tk 9 do not exist, also with--tcl 9.1.- A short form of
scaling,windowingsystem,appdata,insets, ortouchscreen, such astk s, is an error. A short form of the other subcommands works. Tk 8.6.16 accepts a unique short form of each subcommand. - The errors have the
-errorcodeNONE, except a wrong count of arguments. Tk 8.6.16 gives codes such asTCL LOOKUP SUBCOMMANDandTK LOOKUP WINDOW.
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztk 1.0.0-beta.1