Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!orca!mesa!rthomson From: rthomson@mesa.dsd.es.com (Rich Thomson) Newsgroups: comp.windows.x.motif Subject: Re: XmNexposeCallback -- How do I send my own? Message-ID: <1991Apr29.040007.11132@dsd.es.com> Date: 29 Apr 91 04:00:07 GMT References: <1991Apr29.025823.7094@ux1.cso.uiuc.edu> Sender: usenet@dsd.es.com Reply-To: rthomson@dsd.es.com (Rich Thomson) Distribution: local,world,all Organization: Design Systems Division, Evans & Sutherland, SLC, UT Lines: 37 Nntp-Posting-Host: 130.187.85.21 In article <1991Apr29.025823.7094@ux1.cso.uiuc.edu> CWIKLA@uimrl7.mrl.uiuc.edu (John/Consultant) writes: > I basically have a drawingarea widget that at some point I need >the whole thing redrawn. Try the following piece of code: Widget da; XmDrawingAreaCallbackStruct da_struct; da_struct.reason = XmCR_EXPOSE; da_struct.event = (XEvent *) NULL; da_struct.window = XtWindow(da); XtCallCallbacks(da, XmNexposeCallback, (XtPointer) da_struct); If some cosmological aligning of the planets prevents this from working, try: XClearArea(XtDisplay(da), XtWindow(da), 0, 0, 0, 0, True); This will clear your window and generate an expose event. The first solution looks more complicated, but is really preferred because it doesn't actually require a round trip to the server as in the second example. The round trip happens because you request the clear, then receive the expose event from the server, while the first doesn't have to wait for the expose event to arrive before it starts redrawing. Alternatively, if you neeed the window cleared, but don't want to wait for the expose event, set the last parameter to False in the XClearArea call (or use XClearWindow). -- Rich -- ``Read my MIPS -- no new VAXes!!'' -- George Bush after sniffing freon Disclaimer: I speak for myself, except as noted. UUCP: ...!uunet!dsd.es.com!rthomson Rich Thomson ARPA: rthomson@dsd.es.com PEXt Programmer