home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / windows / x / 18891 < prev    next >
Encoding:
Internet Message Format  |  1992-11-09  |  1.1 KB

  1. Path: sparky!uunet!mcsun!sun4nl!orcenl!rgasch
  2. From: rgasch@nl.oracle.com (Robert Gasch)
  3. Newsgroups: comp.windows.x
  4. Subject: Strange Event Processing Problem
  5. Message-ID: <3201@nlsun1.oracle.nl>
  6. Date: 9 Nov 92 10:08:22 GMT
  7. Organization: Oracle Europe
  8. Lines: 28
  9.  
  10. I have a program which in repsonse to a buttonpress has to repeat
  11. a certain action until an event occours (ButtonPressMask | 
  12. ButtonReleaseMask | ExposureMask | KeypressMask | EnterWindowMask |
  13. LeaveWindowMask). The code I'm using to do this once the button has
  14. been pressed looks as follows:
  15.  
  16. while (XEventsQueued(mydisplay, QueuedAlready)==0)
  17.     {
  18.         msleep (100000);         /* sleep for about 1 second */
  19.         if (operation == SELLING)
  20.             {
  21.         do_this ();
  22.                 }
  23.        else
  24.        if (operation == BUYING)
  25.         {
  26.         do_that ();
  27.         }
  28.     }
  29.  
  30. The problem I have is that the program pauses about 1 second (which it
  31. should) and then processes several events right in succession without pausing
  32. in between them (I have no clue how). If anybody an see anything obvious
  33. wrong with this, please let me know.
  34.  
  35. Thanks a lot
  36. --> Robert
  37. rgasch@nl.oracle.com
  38.