HI I am new in perl. I have created one basic perl script to run win32 gui with threads but my gui got stock .......... can any one help me ... posted my code below
main code........................... use threads; use threads::shared; use Win32::GUI (); use Win32::GUI::ThreadUtils; my $win = new Win32::GUI::Window( -name => 'MainWindow', -title => 'Thread_gui', -pos => [100,100], -size => [300,300], ); my $Win2 = new Win32::GUI::Window( -name => "W2", -title => "Timer Window", -pos => [ 150, 150 ], -size => [ 300, 200 ], -parent => $win, ); $Win2->AddButton( -name => 'START', -text => 'Start', -pos => [50, 50], -height => 35, ); $win->AddButton( -name => 'Timer', -text => 'TIMER', -pos => [10, 220], -height => 25, ); $win->AddButton( -name => 'Loop', -text => 'LOOP', -pos => [70, 220], -height => 25, ); $win->AddButton( -name => 'Stop', -text => 'STOP', -pos => [120, 220], -height => 25, ); $win->Show(); Win32::GUI::Dialog(); Win32::GUI::DoEvents(); $Win2->AddButton( -name => "Button2", -text => "Close this window", -pos => [ 10, 10 ], ); sub Button2_Click { $Win2->Hide(); } sub W2_Terminate { $Win2->Hide(); return 0; } sub Timer_Click { print " Timer clicked \n"; $Win2->Show(); my $thr1 = threads->create( \&thread1); $res =$thr1->join(); print "hello $res\n"; }; sub thread1{ my $result = 1; return ($result); }; print "Completed "; sub Loop_Click { print "Loop clicked \n"; $win ->( -activate => (1)); my $thr2 = threads->create( \&thread2); $res =$thr2->join(); print "hello $res\n"; }; sub thread2{ my $result = 2; Win32::GUI::DoEvents(); system ("perl rama.pl"); return ($result); }; sub Stop_Click { return -1;} And Rama.pl file.................below.. $i=0; while ( $i < 5 ) { print" hi ramakanta\n"; sleep 5; } Regards ramakanta
------------------------------------------------------------------------------
_______________________________________________ Perl-Win32-GUI-Users mailing list Perl-Win32-GUI-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users http://perl-win32-gui.sourceforge.net/