in reply to win32::Gui -- Paradigm problem...How do you get info back from a dialog?
Talwyn,
I am not sure if this will help any and I haven't had much luck in understanding the Win32:GUI docs on the matter either, but in the absence of any other reply it might help.
In the underlying api's communication between the dialog proc and the calling program is through so-called "window words". When the Dialog is created a number of "extra" window words (32-bit values if I remember correctly) are requested. Inside the dialog procedure, these values can be modified. Once the call to ShowDlg() or its variants return, the main window proc can then access these window words to retrieve the "answers" from the dialog. Often, a single 'extra' 32-bit word is requested, and a pointer to a data structure allocated in the main proc is placed in there before calling. The dialog proc reteives the pointer, fills in the values accordingly. Once the ShowDlg returns, the main proc can use the pointer to retreive the information.
How faithful the Win32::GUI is to the method of working I can only speculate, but the description (which shouldn't be relied upon for accuracy. Its been a while!) may help you understand the docs and what is going on.
Good luck.
Update:After I submitted, I went to check something and came across this which you have probably seen and isn't very helpful as it refers you to the 'underlying API docs', but the Get/SetWindowLong() calls are the ones you need. You'll see from the calls you can have multiple, indexed WindowLongs. It also strikes me that if your main window proc and the dialog proc (or its controls callbacks) are in the same file, the Perlish way maybe to simply use package globals for this.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: win32::Gui -- Paradigm problem...How do you get info back from a dialog?
by dada (Chaplain) on Jul 05, 2002 at 09:45 UTC | |
by BrowserUk (Patriarch) on Jul 05, 2002 at 10:12 UTC | |
by talwyn (Monk) on Jul 07, 2002 at 20:54 UTC | |
by talwyn (Monk) on Jul 12, 2002 at 06:04 UTC |