home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x
- Path: sparky!uunet!snorkelwacker.mit.edu!bloom-beacon!INTERNET!dont-send-mail-to-path-lines
- From: adrian@ora.COM (adrian)
- Subject: Updating pixmaps in label widgets
- Message-ID: <9211131740.AA00262@spike.ora.com>
- Sender: root@athena.mit.edu (Wizard A. Root)
- Organization: The Internet
- Date: Fri, 13 Nov 1992 12:40:08 GMT
- Lines: 35
-
-
- Someone asked a few days ago how to make a Label widget redraw its
- pixmap. The problem comes up when you want the Label widget to
- display a pixmap that is changing. Since the pixmap ID remains
- constant, there is no way for the widget to know the pixmap has
- been written to.
-
- Here's the code for sending a synthetic Expose event to the widget;
-
- /* send synthetic Expose event: */
- XExposeEvent event;
- event.type = Expose;
- event.serial = 0;
- event.send_event = True;
- event.display = XtDisplay(w);
- event.window = XtWindow(w);
- event.x = 0;
- event.y = 0;
- event.width = 1000;
- event.height = 1000;
- event.count = 0;
-
- XSendEvent(XtDisplay(w), XtWindow(w), True, ExposureMask, &event);
-
-
- If you have the O'Reilly examples for Volume 4, Athena edition,
- you can substitute this for the XClearArea call in redraw_small_picture.
-
- *************************************************************
- Adrian Nye (314) 531-1231 Editor, The X Resource
- O'Reilly & Associates, Inc., Publishers of Nutshell Handbooks
- 4466 West Pine Blvd. 20-G St. Louis MO 63108
- Internet: adrian@ora.com UUCP: uunet!ora!adrian
- *************************************************************
-
-