$self->EVT_PAINT( sub{ my $dc = Wx::PaintDC->new( $frame ); $dc->BeginDrawing(); $dc->DrawRectangle( 100,100, 200,200 ); $dc->EndDrawing(); } );