#!/usr/bin/perl use Win32::GUI(); # Perl module for access to Windows new( -name => 'Main', #name of the window, use for events -width => 675, -height => 600, -text => 'Keno', #title of window -minsize => [675, 600], -dialogui => 1 #contorls special keyboard handling ); ########Controls#################################### # 80 Buttons... Probably better and much more efficient #way... # The subroutine under "-onClick => &Button_Click(x)" is #executing before the app. even shows up #basically I have 80 similar buttons $Button1= Win32::GUI::Button->new(-parent => $main, -pushlike => 1, -name => Button1, -text => '1', -onClick => &Button_Click(1),-height => 50, -width => 50, -pos => [15, 55],); $main->Show(); #By default windows are hidden, so make #it visible... Win32::GUI::Dialog(); #start a Windows message loop, to #get user interaction #######-Event Handlers################################ sub Main_Terminate{ -1; #Terminates loop }; sub Button_Click{ my $arg = $_[0]; #my $size = @chosen; unless( @chosen[9] ) { print "$arg was choosen\n"; push (@chosen, $arg); #my $message = Win32::MsgBox("$arg was choosen", 0, "$arg was choosen"); } else { print "To many numbers chosen\n";} };