hi to all,
I learn more and more about wxPerl, but now I got stuck again.
I am using xrc files for building the GUI.
Now I have a Static bitmap (ID_BITMAP) in my Frame.
I would like to change the image (if a certain condition has been
reached).
I know haow to set a value for example if I have a SpinControl . . .
$frame->FindWindow('ID_SPINCTRL1')->SetValue($actvolume);
but I cant figure out the syntax for an Bitmap image!
Here is the initial snipet of my code (runs on Mac OS X):
my $app = shift;
my $xr = Wx::XmlResource->new();
Wx::InitAllImageHandlers();
$xr->InitAllHandlers();
$xr->Load("$XRCFILE");
my $frame = $xr->LoadFrame(undef, 'ID_WXFRAME');
my $XID = \&Wx::XmlResource::GetXRCID;
#set basic elements
my $audio_on = Wx::Image->new("$localdir/audio-on.png",
wxBITMAP_TYPE_PNG);
my $audio_off = Wx::Image->new("$localdir/audio-off.png",
wxBITMAP_TYPE_PNG);
# . . . removed some line for getting the system volume
if( $actvolume == 0 ) {
$frame->FindWindow('ID_BITMAP')->Set($audio_off);
} else {
$frame->FindWindow('ID_BITMAP')->Set($audio_on);
}
# . . . . rest of code comes here
Greetings Alex