'''Working with xterms''' xterms can be integrated into a Tcl app in several ways: '''Running under xterm control''' This is the simplest case, you just run your app inside an xterm as normal. Either start the xterm and manually interact with the default shell or start xterm with the -e flag with your Tcl program as its arguments. The Tcl/Tk program will run in the xterm. '''Controlling xterm remotely''' A Tcl app can start up xterms '''after''' the Tcl app starts using xterm's -S flag. This really pays off when you need to control multiple xterms. Some Tcl examples: xkibitz - an Expect script that starts multiple xterms, each of which is controlling the same shared process. Works with shells, editors or anything that can run in an xterm. multixterm - an Expect script that starts multiple xterms, each of which is controlling a separate process. A special window is supplied allowing you to type to all xterms at the same time. We use it to ssh to a group of hosts and do ad hoc system administration where we need to see the responses dynamically. '''Reparenting an xterm''' [TkSteal] [TkXext] ---- [GPS] Apr 30 2002 - I recently sent a patch to Thomas E. Dickey for xterm that adds an -into flag. This new flag allows you to embed xterm into a Tk application. It may appear in the release after this (current is #166). In my own application I actually link in the xterm code by renaming xterm's main() to xterm_main(). Then before xterm enters its event loop I fork() and do signal (SIGCHLD, SIG_IGN); Then I added a Tcl command (xterm) that calls xterm_main. The end result is that I have an embedded xterm in a stand-alone executable. If anyone is interested I could post my patch on the Wiki. ---- [[Nice work, GPS!]]