home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / tcl / 2330 < prev    next >
Encoding:
Internet Message Format  |  1993-01-11  |  2.4 KB

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