I'm working on modernizing Rosetta Code's infrastructure. Starting with communications. Please accept this time-limited open invite to RC's Slack.. --Michael Mol (talk) 20:59, 30 May 2020 (UTC)


From Rosetta Code
Wish is an implementation of Tcl. Other implementations of Tcl.
wish is an interface for the Tcl programming language interpreter that provides graphical user interface support that can be scripted with libtcl. Wish loads the Tk library by default; it is virtually identical to tclsh after the execution of the command:
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 geometry global 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 send commands.
-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 argv variable without interpreting them. This provides a mechanism for passing arguments such as -name to 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).