It looks good, but I get "Can't locate auto/win32/GUI/icon.al in @INC"
I get these a lot with Win32::GUI for some reason.  Fresh Perl install
or not.

MJG

-----Original Message-----
From: Chris Wearn [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 30, 2003 11:02 PM
To: MJG
Cc: perl-Win32-GUI-Users@lists.sourceforge.net
Subject: RE: Win32::GUI Icons on buttons


>Is this not the proper way to add an icon to a button?

>$W->AddButton(
>   -name    => "SomeName",
>   -left    => 5,
>   -top     => 5,
>   -text    => "Print Somehing!",
>   -tabstop => 1,
>   -icon    => "./Iconfile.ico"
>);


TRY:
# ================================

# Load Icon
$icoImage = new Win32::GUI::Icon("./images/button.ico");

# Button - SomeName
$btnSomeName = $W->AddButton(
   -name    => "btnSomeName",
   -left    => 5,
   -top     => 5,
   -text    => "Print Somehing!",
   -tabstop => 1,
   -icon    => $icoImage,
);


if -icon => $icoImage,  doesn't work try:

...
   -text    => "Print Somehing!",
   -tabstop => 1,
);
$W->SetIcon($icoImage);


Chris






Reply via email to