home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / windows / x / 19125 < prev    next >
Encoding:
Text File  |  1992-11-14  |  1.5 KB  |  46 lines

  1. Newsgroups: comp.windows.x
  2. Path: sparky!uunet!snorkelwacker.mit.edu!bloom-beacon!INTERNET!dont-send-mail-to-path-lines
  3. From: adrian@ora.COM (adrian)
  4. Subject: Updating pixmaps in label widgets
  5. Message-ID: <9211131740.AA00262@spike.ora.com>
  6. Sender: root@athena.mit.edu (Wizard A. Root)
  7. Organization: The Internet
  8. Date: Fri, 13 Nov 1992 12:40:08 GMT
  9. Lines: 35
  10.  
  11.  
  12. Someone asked a few days ago how to make a Label widget redraw its
  13. pixmap.  The problem comes up when you want the Label widget to
  14. display a pixmap that is changing.  Since the pixmap ID remains
  15. constant, there is no way for the widget to know the pixmap has
  16. been written to.
  17.  
  18. Here's the code for sending a synthetic Expose event to the widget;
  19.  
  20.     /* send synthetic Expose event: */
  21.     XExposeEvent event;
  22.     event.type = Expose;
  23.     event.serial = 0;
  24.     event.send_event = True;
  25.     event.display = XtDisplay(w);
  26.     event.window = XtWindow(w);
  27.     event.x = 0;
  28.     event.y = 0;
  29.     event.width = 1000;
  30.     event.height = 1000;
  31.     event.count = 0;
  32.  
  33.     XSendEvent(XtDisplay(w), XtWindow(w), True, ExposureMask, &event);
  34.  
  35.  
  36. If you have the O'Reilly examples for Volume 4, Athena edition, 
  37. you can substitute this for the XClearArea call in redraw_small_picture.
  38.  
  39. *************************************************************
  40. Adrian Nye (314) 531-1231    Editor, The X Resource
  41. O'Reilly & Associates, Inc., Publishers of Nutshell Handbooks
  42. 4466 West Pine Blvd.  20-G   St. Louis MO 63108
  43. Internet:   adrian@ora.com        UUCP:   uunet!ora!adrian      
  44. *************************************************************
  45.  
  46.