This problem is harder than it seems at first.
The main problem is how do I detect a right click on a menu (Such as the
Exit option on the File menu found in most windows programs)?
Also, to create the menu in your example I'd do;
$Menu = Win32::GUI::MakeMenu(
"Popup Menu" => "PopUpMenu",
> sub OKbutton_Click { .. gather data and return (-1); }
>
> When you return -1 in any event sub, not just in _Terminate, your window
> gets destroyed. Since you cannot exit the Dialog() loop other than
with -1,
> there are but two ways to do it
But that is my problem. I return(-1) to Setup() but
sub OKbutton_Click { .. gather data and return (-1); }
When you return -1 in any event sub, not just in _Terminate, your window
gets destroyed. Since you cannot exit the Dialog() loop other than with -1,
there are but two ways to do it
a) do the error checking inside an event (namely OK_Click).
I have the following general structure that I am using to gather some
intitialization data from the user.
my $errormsg;
do {
setup();
errorcheck();
} until !$errormsg;
sub setup { ... create GUI initialization window with user input fields and
Win32::GUI::Dialog(); }
sub OKbutton_Click {
Assuming $menu 'PopUpMenu' already exists, then do the following:
my ( $x, $y ) = Win32::GUI::GetCursorPos ();
$Window->TrackPopupMenu( $menu -> {'PopUpMenu'}, $x, $y );
-Original Message-
From: moo cow [mailto:[EMAIL PROTECTED]
Sent: Monday, August 26, 2002 22:28
To: perl-win32-gui-us
5 matches
Mail list logo