Hello!
I wrote a simple PerlTk script and after finishing the functionality I decided to change
the icon. So I downloaded a 512x512 PNG file, the beginning of the GUI part of the script looke like:
my $gui_mw_wrapper = new MainWindow;
$gui_mw_wrapper -> geometry("1000x1000");
my $icon = $gui_mw_wrapper -> Photo(-width => 32, -height => 32, -f
+ile => '<absolute path>/code-terminal_15180865.png', -format => 'png'
+);
$gui_mw_wrapper -> iconimage($icon);
and when I run it, the icon is a blank square (as opposed to default PerlTk icon which shows when I comment the 2 last line of sample).
After some reading I saw an advice to have the image the same size as "-width"/"-height" values so I opened GIMP, resized the image
to 32x32, changed the file path line to:
my $icon = $gui_mw_wrapper -> Photo(-width => 32, -height => 32, -f
+ile => '/nas/users/arie/bin/icons/code-terminal_15180865_32x32.png',
+-format => 'png');
and got the same result.
So, what am I doing wrong?
TIA!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.