BUU has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use Wx qw/wxSOLID/; package MGV; use base 'Wx::App'; sub OnInit { my $self = shift; my $frame = Wx::Frame->new( undef, -1, 'title', [500,500], [500,500] ); my $dc = Wx::ClientDC->new( $frame ); $dc->SetBrush( Wx::Brush->new( 'black', Wx::wxSOLID ) ); $dc->DrawRectangle( 100,100, 200,200 ); $frame->Show( 1 ); } package main; MGV->new()->MainLoop();
$self->EVT_PAINT( sub{ my $dc = Wx::PaintDC->new( $frame ); $dc->BeginDrawing(); $dc->DrawRectangle( 100,100, 200,200 ); $dc->EndDrawing(); } );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WxPerl, Wx::ClientDC, displaying images
by Steve_BZ (Chaplain) on Sep 11, 2009 at 02:05 UTC |