NAME
mtwish - Simple windowing shell with threading

SYNOPSIS
mtwish ?options? ?arg arg ...?

OPTIONS
See wish(1) for available options.

DESCRIPTION

Mtwish is a simple program consisting of the Tcl command language, the Tk toolkit, the Tcl threads extension and a main program that reads commands from standard input or from a file. It creates a main window and then processes Tcl commands. If mtwish is invoked with no -f option then it reads Tcl commands interactively from standard input. It will continue processing commands until all windows have been deleted or until end-of-file is reached on standard input. If there exists a file .wishrc in the home directory of the user, mtwish evaluates the file as a Tcl script just before reading the first command from standard input.

If the -file option is provided to Tk, then mtwish reads Tcl commands from the file named in the -file option. These commands will normally create an interactive interface consisting of one or more widgets. When the end of the command file is reached, mtwish will continue to respond to X events until all windows have been deleted. There is no automatic evaluation of .wishrc in this case, but the script file can always source it if desired. See wish(1) for more information.

THREADS
The Tcl threads extension from MTtcl is built into mtwish. Threaded Tk programs should be written carefully because only the ``main'' thread (thread1) can issue Tk commands. Because the Tk library is not multi-thread safe, no other threads should directly invoke Tk commands. Commands can be invoked indirectly by posting a message to thread1. Messages posted to thread1 are automatically evaluated.

SEE ALSO
cond(n), mutex(n), rwlock(n), sema(n), share(n), thread(n), wish(1)

BUGS
Error dialog is not shown for threads (other than thread1)