#!perl -w use strict; use warnings; use Win32::GUI; my $DOS = Win32::GUI::GetPerlWindow(); Win32::GUI::Hide($DOS); # Get text to diaply from the command line my $text = defined($ARGV[0]) ? $ARGV[0] : "Software Update Notification"; # Create a font to diaply the text my $font = Win32::GUI::Font->new( -name => "Comic Sans MS", -size => 24, ); my $main = Win32::GUI::Window->new( -name => 'Main', -text => 'CTG Updates', -width => 300, -height => 200 ); # Add the text to a label in the window my $label = $main->AddLabel( -text => $text, -font => $font, -foreground => 0x0000FF, ); my $icon = new Win32::GUI::Icon('GUIPERL.ICO'); my $ni = $main->AddNotifyIcon( -name => "NI", -id => 1, -icon => $icon, -tip => "CTG Updater" ); $main->AddRadioButton( -name => 'Default', -text => 'Apply updates now', -default => 1, # Give button darker border -ok => 1, # press 'Return' to click this button -width => 125, -height => 20, -left => $main->ScaleWidth() - 200, -top => $main->ScaleHeight() - 100, ); $main->AddRadioButton( -name => 'Cancel', -text => 'Update Another time', -cancel => 1, # press 'Esc' to click this button -width => 125, -height => 20, -left => $main->ScaleWidth() - 200, -top => $main->ScaleHeight() - 80, ); my $textfield = $main->AddTextfield( -name => "Textfield", -text => "have fun and more", -left => 75, -top => 150, -width => 200, -height => 40, -readonly => 1, ); #Win32::GUI::Dialog(); #sleep 30; $main->Show(); Win32::GUI::Dialog(); exit(0); sub Main_Terminate { return -1; } sub Main_Minimize { $main->Disable(); $main->Hide(); return 1; } sub NI_Click { $main->Enable(); $main->Show(); return 1; } sub Default_Click { print "Default button clicked\n"; $main->Hide(); return 0; } sub Cancel_Click { print "Cancel button clicked\n"; $main->Hide(); return 0; }