> Initial Comment:
> Wx::Icon is appears broken.
> I do not Believe it to be a user-error.
> FOr example, if i have a Wx::Frame, and try to load
> and set an icon with the following code
> (which should work)
> ##
> use Wx::Icon;
> # $frame->{wxMorseIcon} = Wx::GetWxPerlIcon();
> $frame->{wxMorseIcon} = new Wx::Icon;
> $frame->{wxMorseIcon}->LoadFile
> ('wxMorse.xbm',wxBITMAP_TYPE_XBM);
> $frame->SetIcon($frame->{wxMorseIcon});
>
> nothing happens.
> if this is something i'm doing wrong on my part, I
> deeply apologize, and I request that yo delete this
> post ASAP, but if not, it'd be nice if you'd look into
> getting this working in the next release (i'd be real
> glad, and probably a few others too ;)
>
> I attached a sample file, with the .xbm contained
> after __DATA__
>
Try this code. It was testd with wxPerl 0.10 and Win32.
-------------------------------------------------
use Wx qw(wxBITMAP_TYPE_ICO wxBITMAP_TYPE_XPM);
Wx::InitAllImageHandlers();
if( $Wx::_platform == $Wx::_msw ) {
$icon = Wx::Icon->new( $file , wxBITMAP_TYPE_ICO , -1 , -1 );
} else {
$icon = Wx::Icon->new( $file , wxBITMAP_TYPE_XPM );
}
$frame->SetIcon( $icon );
-------------------------------------------------
Graciliano M. P.
|