+ wxDC& dc = *event.GetDC();
+ dc.SetPen(*wxGREEN_PEN);
+
+ // this line is needed, otherwise the junk is left on win the background
+ dc.Clear();
+
+ wxSize size = GetClientSize();
+ for ( int x = 0; x < size.x; x+= 10 )
+ {
+ dc.DrawLine(x, 0, x, size.y);
+ }
+
+ for ( int y = 0; y < size.y; y+= 10 )
+ {
+ dc.DrawLine(0, y, size.x, y);
+ }
+
+ dc.SetTextForeground(*wxRED);
+ dc.DrawText(_T("This text is drawn from OnEraseBackground"), 60, 60);