home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / windows / x / intrinsi / 711 < prev    next >
Encoding:
Text File  |  1993-01-05  |  1.6 KB  |  39 lines

  1. Newsgroups: comp.windows.x.intrinsics
  2. Path: sparky!uunet!enterpoop.mit.edu!paperboy.osf.org!paperboy!drand
  3. From: drand@spinner.osf.org (Douglas S. Rand)
  4. Subject: Re: Validity of having two event loops in Xt
  5. In-Reply-To: as@chopper.b11.ingr.com's message of 5 Jan 93 15:10:25 GMT
  6. Message-ID: <DRAND.93Jan5112810@spinner.osf.org>
  7. Sender: news@osf.org (USENET News System)
  8. Organization: Open Software Foundation
  9. References: <1993Jan5.151025.4055@b11.b11.ingr.com>
  10. Date: 5 Jan 93 11:28:10
  11. Lines: 26
  12.  
  13. In article <1993Jan5.151025.4055@b11.b11.ingr.com> as@chopper.b11.ingr.com (Anirudha Sahoo) writes:
  14.  
  15.      My last posting was garbled, that's why I am posting it again.
  16.  
  17.       I have a xclient that uses Xt. It has two event (infinite) loops. One is in 
  18.    the main routine and the other is in the Callback routine. I think it's 
  19.    definitely a bad programming style, but is it *allowed* by X standard? I am not 
  20.    very much familiar with Xt programming.
  21.  
  22. You might also consider shorter lines :)
  23.  
  24. You do not generally need more than one event loop in a proper
  25. X Toolkit program.  There are definitely problems with trying to
  26. call XtDispatchEvent within a callback.  I don't think the code
  27. is reentrant (This is all best of recollection,  I haven't looked
  28. at it in awhile).
  29.  
  30. You should consider one of the books on programming with the toolkit
  31. in order to gain some coding guidelines.  I did find them quite useful
  32. when I was starting on the toolkit.
  33.  
  34. --
  35. Douglas S. Rand <drand@osf.org>        OSF/Motif Dev.
  36. Snail:         11 Cambridge Center,  Cambridge,  MA  02142
  37. Disclaimer:    I don't know if OSF agrees with me... let's vote on it.
  38. Amateur Radio: KC1KJ
  39.