Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Win32::GUI - error adding a bitmap in button

by levW (Beadle)
on Jun 21, 2017 at 14:55 UTC ( [id://1193213]=perlquestion: print w/replies, xml ) Need Help??

levW has asked for the wisdom of the Perl Monks concerning the following question:

Win32::GUI - error adding a bitmap in button:

my @bitmap; my $path1 = "reload-page.jpg"; my $icoImage = new Win32::GUI::Bitmap($path1) || warn "bitmap:$!\n"; push(@bitmap, $icoImage); $buttons->{$counters1} = $main->AddButton(-name =>"ReloadUsers", -text + => "ReloadUsers",-font => $font13,-pos => [ 600, 101 ], -onClick => sub {&ReloadUsers});

Getting an error: bitmap:Bad file descriptor....

Will appreciate any help

Replies are listed 'Best First'.
Re: Win32::GUI - error adding a bitmap in button
by stevieb (Canon) on Jun 21, 2017 at 15:01 UTC

    Hi levW, please put your code within <code>code here...</code> code tag to format it in such a way that it is readable.

    Your normal paragraphs should be put into <p></p> tags for the same reason.

Re: Win32::GUI - error adding a bitmap in button
by Anonymous Monk on Jun 21, 2017 at 18:26 UTC
    Where are you getting this error from?

    Try using an absolute path in $path1 instead of just the filename

    Also, $path1 is better written as $reloadPage or $reload_button_file or ...

    Not sure I see any connection between the bitmap and the button

      Thanks,

      will comply with formatting in future - I'm new to this forum.

      Tried using the absolute path - still the same error from cmd, when the program starts .

        I think your problem is you're trying to load a .jpg and not a .bmp
Re: Win32::GUI - error adding a bitmap in button
by Laurent_R (Canon) on Jun 21, 2017 at 19:54 UTC

      Hi,<P. Why was it needed to repeat this advice a third time 5 hours later? (preview was the first time, stevieb second time, OP hasn't returned yet)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1193213]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-23 22:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found