in reply to Re: Re: win32::Gui -- Paradigm problem...How do you get info back from a dialog?
in thread win32::Gui -- Paradigm problem...How do you get info back from a dialog?
I tried the Global hash approach and it works ...sort of...
I think I need some pointers on how to tune DoEvents(). When I entered data in the dialog box I got ~880 key repetitions. I was able to get those 880 letters back to the originating function though... so I'm making progress.
Snippet Follows
#Events----------------------------------------------- sub ::Dialog1_Terminate { defined(my $win = $Win32::GUI::Loft::window{winMain}) or return(1); print_dbg(" I am now enabling the window!"); $win->Enable(); return(1); } sub ::btnDialog1_Click{ defined(my $win = $Win32::GUI::Loft::window{Dialog1}) or return(1); our %MSG = %main::MSG; my $text = $win->tfDialog1->Text(); $MSG{"Dialogue"}{"Text"}= $text; return -1; } #App---------------------------------------------- sub GetDestination{ #( $combobox ) #This function returns the drive library or other Destination #Selected in the Combobox object passed to it. my $combobox = shift; local %::MSG = %main::MSG; defined(my $win = $Win32::GUI::Loft::window{winMain}) or return(1); #Ensure $combobox is infact a combobox object abort if not. unless ( "ComboBox" eq $combobox->GetClassName() ){ print_dbg ($combobox->GetClassName()); die "REcieved a bad object!"; } my $destination = $combobox->Text(); print_dbg ("Selected:".$destination); $destination =~s/\s//; if ($destination eq ''){ print_dbg ("No Destination!"); $win->Disable(); # disable main window until we get info we ne +ed. my $dlg = configure_window ('dialog.gld'); $dlg = build_window($dlg, "Dialog1"); $dlg->lblPrompt->Text( "You must enter a destination. \n". 'Type one in the box below.'); $dlg->Show(); do{ Win32::GUI::DoEvents(); } until ($::MSG{"Dialogue"}{"Text"} ne ''); print_dbg ("The user entered: ".$::MSG{"Dialogue"}{"Text"}); } print_dbg ("I AM A STUB FIX ME!"); return ($destination); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: win32::Gui -- Paradigm problem...How do you get info back from a dialog?
by talwyn (Monk) on Jul 12, 2002 at 06:04 UTC |