Urs Grendelmeier wrote:
> Hi Aldo
>
> I tried this (your example) but my question is -
> how do I provide such an event? My sub Graphic_Paint
> is never called.
it wasn't a complete example...
anyway, I've just discovered that AddGraphic is not
yet implemented, so you should use "new Win32::GUI::Graphic"
instead.
here is the complete example which should really work:
use Win32::GUI;
$Window = new Win32::GUI::Window(
-name => "Window",
-pos => [ 0, 0 ],
-size => [300, 200 ],
);
new Win32::GUI::Graphic(
$Window,
-name => "Graphic",
-pos => [ 0, 0 ],
-size => [ $Window->ScaleWidth, $Window->ScaleHeight ],
);
$Window->Show();
Win32::GUI::Dialog();
sub Graphic_Paint {
my($DC) = @_;
my $grey = new Win32::GUI::Pen(
-color => [ 128, 128, 128 ]
);
my $white = new Win32::GUI::Pen(
-color => [ 255, 255, 255 ]
);
$DC->SelectObject($grey);
$DC->MoveTo(0, 5);
$DC->LineTo(200, 5);
$DC->SelectObject($white);
$DC->MoveTo(0, 7);
$DC->LineTo(200, 7);
$DC->Validate();
}
sub Window_Terminate { -1 }
cheers,
Aldo