Re: Win32lib dialogs within proc's
- Posted by Irv Mullins <irv at ELLIJAY.COM> Mar 10, 2000
- 454 views
----- Original Message ----- From: Matthew Lewis <MatthewL at KAPCOUSA.COM> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Friday, March 10, 2000 10:59 AM Subject: Re: Win32lib dialogs within proc's > OK, I think I gave a bad example. Basically, I was using the > getOpenFileName dialog as an easy way to get some input from the user in a > generic sense. I guess what I'd like to do is be able to create my own > dialogs that could be used in a similar manner. I think this works because > you hand over control to windows using the common dialog, which does it's > thing and then gives control back to Eu. Ermm. I have dozens of such "user built dialogs" in my programs. I just build a new window, place an edit text and/or checkboxes or radio buttons as needed, and probably an "OK" button and a "cancel" button, which when clicked transfer the info or do the task called for, then close the window. > Basically, I'd like to be able to 'emulate' that ability. I haven't been > able to think of any nice solutions to this. I guess what I'd need is > another event loop, like by nesting a call to WinMain within a call to > WinMain. I guess that would require some sort of 'namespace' architecture > on the part of win32lib, to keep controls of the various event loops > separate. I'm trying to think of where something like this would be needed. So far, nothing comes to mind. > Hmmm. This would help me with something else that's been bothering me with > windows programming. I've found that I have to make a lot of vars global > (at least local, and not private to a routine), and use procedures > everywhere to manipulate vars rather than cleaner functions and less global > vars--since we don't know when the user will trigger any given event (eg, > Button_onClick) and send us back to the main flow of our program. Actually, there shouldn't be many globals required. Perhaps you need to reconsider how your program functions. In Windows, there's generally _not_ a main flow - just a state that is modified in response to events, and perhaps some procedures that are run on demand. (sort, print, etc) Regards, Irv