Contents Up Previous Next

Querying the update region

Call me lazy:

BEGIN_EVENT_TABLE(MyWindow, wxWindow)
    EVT_PAINT  (MyWindow::OnPaint)
END_EVENT_TABLE()

void MyWindow::OnPaint( wxPaintEvent &event )
{
    wxPaintDC dc(this);
    
    if (IsExposed( 0, 0, 100, 100))
    {
        dc.SetPen( *wxBLACK_PEN );
        dc.SetBrush( *wxRED_BRUSH );
        
        dc.DrawRectangle( 0, 0, 100, 100 );
    }
}