Submitted by Anonymous on Tue, 05/15/2001 - 13:24. Developers
Sorry for silly question I am newbie in Motif.
I am tryng send Expose event to application by code
XEvent prEvent;
XExposeEvent evt;
evt.window = XtWindow(drowWidget);
evt.x = 0;
evt.y = 0;
evt.width = 1000;
evt.height = 1000;
evt.count = 0;
prEvent.type = Expose;
prEvent.xexpose = evt;
XSendEvent(XtDisplay(drowWidget), XtWindow(drowWidget), false, 1, &prEvent);
But unseccesseful. Could somebody please help my find my fault?
An XEvent is a union of many types of events, including Expose events. So, in your example, you should have only one event -- either an XEvent whose fields you can access, for example, as prEvent.xexpose.width, or an XExposeEvent, whose fields you access as above and which you can cast a pointer to as a pointer to an XEvent, as necessary. You seem to be confusing the two access types. The fourth field should probably also be ExposureMask instead of "1". See http//www.motifzone.com/resources/man/XSendEvent.html for some details.
In any case, if you simply want to clear an area, you can use XClearArea() or XClearWindow().