package require Tk
The minor differences have to do with how the program interacts with the user, especially on Windows.
Wish takes a number of arguments itself (in addition to the
-encoding option that tclsh supports) which it uses as options when creating the initial
toplevel window (
.), which are described on the wish(1) manual page. The most useful ones on modern X11-based desktops are:
- -display display
- Display (and screen) on which to display window.
- -geometry geometry
- Initial geometry to use for window. If this option is specified, its value is stored in the
geometryglobal variable of the application's Tcl interpreter.
- -name name
- Use name as the title to be displayed in the window, and as the name of the interpreter for
- -use id
- Specifies that the main window for the application is to be embedded in the window whose identifier is id, instead of being created as an independent toplevel window.
- Pass all remaining arguments through to the script's
argvvariable without interpreting them. This provides a mechanism for passing arguments such as
-nameto a script instead of having wish interpret them.
The -display option is not useful when Tk is not built for X11; other display systems (Windows, MacOS X native) always work locally. (This also applies to all of the wish-specific options not listed above, but they're also largely irrelevant on X11 systems too, even if they are supported there.)
Wish ceases running when the event loop becomes idle and there are no windows to display (including withdrawn windows).