The IPaintHandler class processes paint events for any window or control that requires the window or control to update its appearance on the screen.
Create a handler derived from IPaintHandler and attach it to a window or control. You can do this by calling IHandler::handleEventsFor to pass the window or control to the paint handler.
When the paint handler receives a paint event, it creates an IPaintEvent object and routes that object to the IPaintHandler::paintWindow virtual function. Override this virtual function to supply your own specialized processing of a paint event.
The return value from the virtual function specifies whether the paint event is passed on for additional processing, as follows:
Objects of the IPaintEvent class represent a Motif expose event.
Constructors & DestructorOnly derived classes can construct objects of this class.
![]() |
protected:
IPaintHandler()
Derived classes call this default constructor to create objects of this class.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Event DispatchingThe Open Class Library dispatches events that have been sent or posted to a window to the handlers attached to that window. It does this by calling the event-dispatching function of the handler objects. An IPaintHandler object processes only window paint events.
![]() |
protected:
virtual bool dispatchHandlerEvent(IEvent& event)
If a paint event is received, this function calls the appropriate virtual function.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Event ProcessingA resize handler contains event-processing members that you use to process a window paint event. Override at least one of these virtual functions in a derived class.
![]() |
protected:
virtual bool paintWindow(IPaintEvent& event) = 0
Implemented by derived classes to handle a paint event. A derived class must supply this function.
You should make all window updates using the presentation space handle returned by IPaintEvent::presSpaceHandle.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
virtual ~IHandler()
virtual IString asDebugInfo() const
virtual IString asString() const
virtual IHandler& disable()
virtual IHandler& enable(bool enable = true)
virtual IHandler& handleEventsFor(IWindow* window)
IHandler()
bool isEnabled() const
virtual IHandler& stopHandlingEventsFor(IWindow* window)
virtual IEventResult defaultProcedure(IEvent& event)
virtual bool dispatchHandlerEvent(IEvent& event) = 0