Well, it still doesn't look like I'm getting it, but I am trying to get
this to minimize to the sys tray. Anyone with experience in this see
where I am missing the boat?
Thanks in advance
Mal
# Hello.pl script from SourceForge.Net
use Win32::GUI;
$MW = new Win32::GUI::Window(
-title => 'hello.pl',
-left => 100,
-top => 100,
-width => 250,
-height => 100,
-name => 'MainWindow',
-visible => 1,
);
$hello = $MW->AddButton(
-text => 'Hello, world',
-name => 'Hello',
-left => 25,
-top => 25,
);
$goodbye = $MW->AddButton(
-text => 'Goodbye World',
-name => 'Goodbye',
-left => 125,
-top => 25,
);
$SysTray = new Win32::GUI::Icon('CAMEL.ICO');
$MW->Show();
$rc = Win32::GUI::Dialog(0);
sub MainWindow_Terminate {
$MW->PostQuitMessage(1);
# return -1;
}
sub Hello_Click
{
if($MW->Hello->Text eq "Hello, world")
{
$MW->Hello->{-text} = "OneMoreTime";
} else {
print STDOUT "Hello, world\n";
$MW->PostQuitMessage(0);
}
}
sub Goodbye_Click
{
if($MW->Goodbye->Text eq "Goodbye World")
{
$MW->Goodbye->{-text} = "OneMoreTime";
} else {
print STDOUT "Goodbye, world\n";
$MW->PostQuitMessage(0);
}
}
sub SysTray_Click
{
print "Here! \n";
$MW->Hide();
$MW->Disable();
}
sub Restore_Click
{
$MW->Enable();
$MW->Show();
}