Its a simple script that displays a dialog window which contains a single button. Clicking the button or the 'close app' icon (small 'X' on the title bar) should end the program run.
It works as expected until I uncommment the package declaration line. At that point the button clicks are no longer recognized and using the 'close app' icon only hide()'s the window and doesn't properly call the *_Terminate function.
Is there something I'm doing wrong or is it an issue with Win32::GUI accessing package level items even though the session was initiated from the same package? -Nitrox
#package gui_test; use strict; use warnings; use Win32::GUI; display_gui(); exit; sub btnCancel_Click {-1;} sub Main_Terminate {-1;} sub display_gui { my $main = Win32::GUI::DialogBox ->new( -name => "Main", -text => "GUI Test", -width => 200, -height => 200, -top => 200, -left => 200, ); my $btn_cancel = $main->AddButton( -name => "btnCancel", -cancel => 1, -text => "Cancel", -left => 100, -top => 100, ); $main->Show(); Win32::GUI::Dialog(); }
In reply to Using Win32::GUI in a package by Nitrox
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |