From: Youen T. <you...@wa...> - 2009-05-20 18:05:26
|
John Labenski a écrit : > > 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(). I'm not used to GUI programs, but the fact that they "usually [...] are event loop based" does not mean it is the best solution :-) Lua provides an interesting tool that do not exist natively in C (the coroutines), and that can, in my opinion, help make programs easier to write and easier to read. Maybe its a bad idea, but until now, it works fine for me, excepted this callback problem. I've solved the problem by creating a small module that allows to execute, from a coroutine, a function in the main thread. It helps to keep the main thread code independant from the coroutine code. My application works fine now, thanks for the help. |