in reply to Win32::GUI bitmap

to add to this... the following code works fine
use Win32::GUI; $main = new Win32::GUI::Window( -name => 'Main', -title => 'temp', -width => '325', -height => '310', -minsize => ['300', '310'], -style => WS_OVERLAPPEDWINDOW, ); $main->Show(); $ok = "42"; $bitmap = new Win32::GUI::Bitmap("images/$ok.bmp"); push (@{$tmp},$main->AddLabel( -text => 'pic', -name => 'label_bitmap', -top => '25', -left => '10', -style => '14', -visible => '1', -background => [255,255,255], -foreground => [0,0,0], )); $tmp->[0]->SetImage($bitmap); Win32::GUI::Dialog(); sub Main_Terminate { -1; }
and this is very close to what happens in my program... the only difference is that i use subroutines...

Replies are listed 'Best First'.
Re: Re: Win32::GUI bitmap
by sarnold_8 (Initiate) on Apr 05, 2003 at 08:53 UTC
    An important side note (thanks to Johan Lindstrom) is that the "$bitmap" is only valid in its current scope, ie, if you make this a function and return, then the $bitmap is no longer valid (bug in GUI), so you'll need to make it global. I tried this numerous ways an got a lot of headaches until this was "uncovered".