re monthly question about xcopyarea and expose events nd posting of the question that just doesn t seem to get answered suppose you have an idle app with a realized and mapped window that contains xlib graphics a button widget when pressed will cause a new item to be drawn in the window this action clearly should not call xcopyarea or equiv directly instead it should register the existence of the new item in a memory structure and let the same expose event handler that handles regular expose events e g window manager driven exposures take care of rendering the new image using an expose event handler is a proper way to do this because at the time the handler is called the xlib window is guaranteed to be mapped the problem of course is that no expose event is generated if the window is already visible and mapped what we need to do is somehow tickle the window so that the expose handler is hit with arguments that will enable it to render just the part of the window that contains the new item what is the best way to tickle a window to produce this behavior if i understand your problem correctly you want to have a way to send exposures to your manager widget when your app specific code draws xlib graphics on the window it sounds like you might want to send an exposure using xsendevent and specifying a region if you know the region you need to send the exposure generally you have the bounding rectangle of the objects you can use xcreateregion to create a region xunionrectwithregion to add the new object polygons to the region and then either use the region to clip your gc for the redraw or use xrectinregion to test which of your other objects need to be redrawn keeping in mind that the stacking order of overlapping objects affects how they look hope it helps brian dealy it not knowing where it s at dealy kong gsfc nasa gov that s important it s knowing uunet dftsrv kong dealy where it s not at b dylan brian dealy it not knowing where it s at dealy kong gsfc nasa gov that s important it s knowing uunet dftsrv kong dealy where it s not at b dylan
