Functions | |
void | SmartWin::AspectBackgroundColor::onBackgroundColor (typename MessageMapType::itsBrushFunctionTakingCanvas eventHandler) |
Setting the event handler for the "erase background" event. |
void onBackgroundColor | ( | typename MessageMapType::itsBrushFunctionTakingCanvas | eventHandler | ) | [inherited] |
Setting the event handler for the "erase background" event.
The erase background event is raised when the Widget needs to redraw its background.
Since the Brush object needs to live past the function call we use a BrushPtr to wrap the Brush object into, you can for instance add a BrushPtr object as a member of your Widget class and return that BrushPtr from your event handler.
The parameter passed is Canvas & and return value is BrushPtr
Note!
It is imperative that you keep a reference to the BrushPtr yourself somewhere e.g. as member of class since otherwise the brush will be released before it is returned to the system and cannot be used!