Re: Yielding event loop



Mark Tilford wrote:
> I hope this isn't too unclear:
> 
> For various reasons, one handler needs to do something moderately
> complex, and partway through, I need to get input from another widget.
>  The stack frame is involved enough that I can't easily return; I want
> the program to be portable (and I'd prefer to avoid trying to
> synchronize threads if possible).
> 
> Is it possible to have the handler simply transfer control back to the
> main event loop until the other widget sends its message?

You can try creating a new `Glib::MainLoop' and invoking run() on it.
This will probably work as gtk_dialog_run() is implemented like this
(only in C.)

On the other hand, synchronizing with `Glib::Dispatcher' is really easy,
why not do it?  AFAIK using threads/mutexes is as portable as GLib
itself.

Paul



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]