wxMac, PaintEvent

Stefan Csomor csomor at advancedconcepts.ch
Mon Sep 18 09:59:50 PDT 2006


Hi 

> We just detected that calling refresh() for a wxPanel
> (pPanel->Refresh()) doesn't cause the parent to get the paint 
> event. In opposite to windows, where the parent gets that event, too.

yes, on mac the redraws are minimized, also from an wx-API standpoint,
Refresh is only guaranteed to refresh the window that gets the refresh
and its children, but never the parent
 
> I really seem to have a wrong understanding of how wxPanels 
> should be used. Currently, I use (some of) them as a 
> 'paintable window', where the parent of the panel decides 
> what to draw on it.

wxPanels are windows, not just drawable areas, so yes, you will have to
connect the events in another way, or call back upon the parent from the
paint events of the chilrdren. Or just invalidate the parent. The best
way would be to have a proper model-view-control setup.

Best,

STefan




More information about the wx-users mailing list