I've been trying to use
Win32::GUI:Bitmap() and to no success.
Here's the code
sniplet:
...mainwindow built before
this...
my ($img, $btn,
$bname);
$bname =
"listbox.bmp";
print "bitmap is $bname\n";
if( -e $bname ) {
$img = new Win32::GUI::Bitmap( $bname ) || die "Error: $bname $!\n";
print "bitmap is $bname\n";
if( -e $bname ) {
$img = new Win32::GUI::Bitmap( $bname ) || die "Error: $bname $!\n";
}
else {
warn "Bitmap file $bname does not exist, skipping it!\n";
return 0;
}
$btn = $winTool->AddButton(
-text => "BTN",
-name => "button",
-bitmap => $img,
-top => 25,
-left => 25,
-width => 25,
-height => 25,
);
$btn->SetImage( $img );
else {
warn "Bitmap file $bname does not exist, skipping it!\n";
return 0;
}
$btn = $winTool->AddButton(
-text => "BTN",
-name => "button",
-bitmap => $img,
-top => 25,
-left => 25,
-width => 25,
-height => 25,
);
$btn->SetImage( $img );
It prints out that the $img and $bname are all ok,eg they
exist and that $img has a value.
I'm using ActiveState PERL
560.
The window displays and shows a blank button. The bitmap is
20x20 and I've put the width/height to be 100,100 to see if thats the
problem.
thanks,
-Stuart
My
opinions are my own and only stated at the top of large water
towers...