Hi everyone
I tried to change my perl window's icon by
use strict;
use warnings;
use diagnostics;
use Win32::GUI();
$|=1;
my $thisWindow = Win32::GUI::GetPerlWindow();
until($thisWindow) #doesn't always work at 1st
{
#print "Rechecking winID\n";
sleep 1;
$thisWindow = Win32::GUI::GetPerlWindow();
#print 'winID = '.$thisWindow."\n";
}
my $icon = new Win32::GUI::Icon('box.ico');
print "beofre\n";
if(1) #tried if 0 as well
{
Win32::GUI::ChangeIcon($thisWindow, $icon );
Win32::GUI::ChangeSmallIcon($thisWindow, $icon );
}else
{
$thisWindow->ChangeIcon($icon );
$thisWindow->ChangeSmallIcon($icon );
}
print "after\n";
sleep 5;
exit;
But nothing works.
in the if(0) version it says
Can't call method "ChangeIcon" without a package or object referenc
and in the if(1) version, nothing happens (but the prints ^^).
What am I doing wrong ?
Could this have something to do with the fact I'm running in Padre ?
Thx
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.