home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!mailgzrz.tu-berlin.de!garfield
- From: garfield@cs.tu-berlin.de (Sven Delmas)
- Newsgroups: comp.lang.tcl
- Subject: Re: TCL as widget server
- Date: 11 Jan 1993 13:51:15 GMT
- Organization: Techn. Univ. Berlin (Germany)
- Lines: 39
- Distribution: world
- Message-ID: <GARFIELD.93Jan11145114@desaster.cs.tu-berlin.de>
- References: <BLK.93Jan8162050@vanity.mitre.org>
- NNTP-Posting-Host: desaster.cs.tu-berlin.de
- In-reply-to: blk@mitre.org's message of Fri, 8 Jan 1993 21:20:50 GMT
-
- In article <BLK.93Jan8162050@vanity.mitre.org> blk@mitre.org (Brian L. Kahn) writes:
-
- I would like to use TCL to add scrollbars to emacs. I don't want to
- modify emacs itself (for other reasons), so I thought I could use a
- wish shell and communicate via pipes. Unfortunately, my initial
- investigation into wish have turned up dry on 'reparenting', which I
- think is vital to my scheme. Is there some way to get wish widgets to
- adopt existing windows, and manage them as children? I know X
- supports this, and that I could compile TCL into a program of my own
- that just does reparenting in C and makes the function a TCL program
- and handles pipes nicely - but isn't there an easier way?
- A good way (in my opinion :-) to get the output from annother
- application (using X) is accessing the server window id. My TkEmacs
- widget works this way. I took the frame widget, and added some special
- stuff to handle X events, and to communicate with emacs via tclRawTCP.
-
- To display the output in the window of the frame widget I send the
- window id of the frame widget to emacs. The patched emacs uses this
- window id for his output. To receive events emacs creates a (never
- mapped) window. The window id is sent to the frame widget. The frame
- widget forwards all events to this window id. This scheme should work
- with all X applications that use one toplevel window to show their
- output.
-
- I used this type of "reparenting" with emacs, ghostscript and gnuplot,
- and it always worked (ghostscript and gnuplot where integrated into a
- different widget set, not Tk). You have to patch the application you
- want to integrate. Perhaps there is a way to prevent this, but right
- now I see no way.
-
- Sven
-
- --
- ----
- Sven Delmas (Techn. Univ. Berlin)
- garfield@cs.tu-berlin.de
- ----
- For every problem there is a solution which is simple, clean and wrong.
- Henry Louis Mencken
-