tk windowingsystem
Gives the name of the windowing system of the app.
tk windowingsystem
Description
Gives the value of Tk for the platform of the program: win32 on Windows, aqua on macOS, and x11 on Linux and BSD, with X11 or with Wayland. Tk has no value for iOS, Android, or the web, and there the result is x11, the value that a script of Tk treats as the general case. The flag --windowingsystem NAME of the ztk program sets another name, such as x11 on macOS for a script that has only its X11 path.
A script that runs its aqua or win32 path can use parts of Tk that ztk does not have, such as the themes aqua and vista of ttk, the colors of the system such as systemButtonFace, and the attributes -modified and -toolwindow of wm attributes. ztk::platform gives the backend itself, such as wayland or web.
Returns
x11, win32, or aqua, or the name of --windowingsystem.
Examples
% expr {[tk windowingsystem] in {x11 win32 aqua}}
1
Errors
% tk windowingsystem x
wrong # args: should be "tk windowingsystem"
-errorcode TCL WRONGARGS
Differences from Tcl
- On iOS, Android, and the web the result is
x11. Tk 8.6.16 does not run there.
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztk 1.0.0-beta.1