home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / windows / x / motif / 8165 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  1.9 KB

  1. Path: sparky!uunet!vtserf!creatures!csgrad.cs.vt.edu!ramakris
  2. From: ramakris@csgrad.cs.vt.edu (S.Ramakrishnan)
  3. Newsgroups: comp.windows.x.motif
  4. Subject: Re: two processes with one window?
  5. Message-ID: <3944@creatures.cs.vt.edu>
  6. Date: 21 Dec 92 21:57:04 GMT
  7. References: <1992Dec18.144058.20973@walter.bellcore.com>
  8. Sender: usenet@creatures.cs.vt.edu
  9. Organization: VPI&SU Computer Science Department, Blacksburg, VA
  10. Lines: 29
  11.  
  12. In article <1992Dec18.144058.20973@walter.bellcore.com> john@bivalve.bellcore.com (John Snow) 
  13. writes:
  14.  
  15.   >I have a situation where I want a background program to have control of
  16.   >a portion of a window, specifically a drawing area.  It would be nice if
  17.   >I could fork off another process and pass it the widget id of the drawing
  18.   >area, but I know things couldn't possibly be that easy.  Is it possible
  19.   >to do something like this, and if so, could someone give me some hints
  20.   >as to how to do it?
  21.  
  22. Its indeed possible to fork and have the child take care of a portion of the drawing area.
  23. However, the child should not access the same display connection (ConnectionNumber(display))
  24. as the parent. Otherwise, your processes will hang.
  25.  
  26. That is, the child must open the display afresh. The parent and the child *should not*
  27. share the widget tree, since widget points to the ConnecionNumber. That is, 
  28. the child had better be a separate program, managing the drawing area using Xlib 
  29. calls alone, after opening the display. Prior to forking, you may store the window id of 
  30. the drawing area and the (x,y,width,height) of the section that the child needs to 
  31. manage in a rootwindow property and have the child access it after it comes up.
  32.  
  33. Unless the drawing/repainting of the drawing area is unusually complex, the gain in
  34. execution efficiency does not warrant the yucky implementation that
  35. is bound to result with the use of forking.
  36.  
  37.   >    John Snow
  38.  
  39. ---
  40. S Ramakrishnan, CS Dept, McBryde Hall, VaTech
  41.