From: Gossett, M. <mal...@ve...> - 2002-08-26 21:38:42
|
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? =20 Thanks in advance =20 Mal =20 # Hello.pl script from SourceForge.Net =20 use Win32::GUI; =20 $MW =3D new Win32::GUI::Window( -title =3D> 'hello.pl', -left =3D> 100, -top =3D> 100, -width =3D> 250, -height =3D> 100, -name =3D> 'MainWindow', -visible =3D> 1, ); =20 $hello =3D $MW->AddButton( -text =3D> 'Hello, world', -name =3D> 'Hello', -left =3D> 25, -top =3D> 25, ); =20 $goodbye =3D $MW->AddButton( -text =3D> 'Goodbye World', -name =3D> 'Goodbye', -left =3D> 125, -top =3D> 25, ); =20 $SysTray =3D new Win32::GUI::Icon('CAMEL.ICO'); =20 $MW->Show(); $rc =3D Win32::GUI::Dialog(0); =20 sub MainWindow_Terminate { $MW->PostQuitMessage(1); # return -1; } =20 sub Hello_Click=20 { if($MW->Hello->Text eq "Hello, world")=20 { =20 $MW->Hello->{-text} =3D "OneMoreTime"; } else { print STDOUT "Hello, world\n"; $MW->PostQuitMessage(0); } } sub Goodbye_Click=20 { if($MW->Goodbye->Text eq "Goodbye World")=20 { $MW->Goodbye->{-text} =3D "OneMoreTime"; } else { print STDOUT "Goodbye, world\n"; $MW->PostQuitMessage(0); } } =20 sub SysTray_Click { print "Here! \n"; =20 $MW->Hide(); $MW->Disable(); =20 }=20 =20 sub Restore_Click { $MW->Enable(); $MW->Show(); } =20 =20 |