From: lostgallifreyan <los...@gm...> - 2009-05-20 09:34:34
|
John Labenski <jla...@gm...> wrote: (20/05/2009 01:24) >On Tue, May 19, 2009 at 2:14 PM, Youen Toupin <you...@wa...>wrote: > >> John Labenski a écrit : >> > I think that all you need to do is to shuffle around your existing >> > code to pull out the dialog creation from the coroutine code, I also >> > demonstrate how to pass data around without using globals. >> Yes, this is a solution, but I would like to avoid it if possible. My >> idea is to use coroutines to have a flexible system that would allow >> sequential programming to perform tasks even when these tasks require >> user action, or waiting for anything without blocking the application. >> The promptUser function is only an example. I'd like to be able to write >> things like: >> > >I'm not sure I understand. GUI programs usually don't work this way, they >are event loop based and therefore they are not sequential. If you want to >pop up a dialog that is non-modal simply use wxDialog:Show(true) instead of >ShowModal(). > Not that I think my knowledge is enough to warrant high observance, but I back this up. I said this earlier too. I'm recently learning C (on TCC compiler, using API), and learned that wxLua (at least, wxWidgets is so both) is very like C being based in it. Modeless dialogs will sit and wait while the rest of program hangs on every word otherwise uttered by the event loop. I used to hate this concept, being taught on linear sequences that always had to halt while waiting for input, but now I really like this event loop thing. |