Hi,
If single iterations of the simulation processing are short then you may
prefer scheduling them with g_idle_add() and g_timeout_add() families
of functions. No need to mess with multiple main loops and contexts. See more
here:
https://developer.gnome.org/glib/stable/glib-The-Main-Event
Having said this, if you have a simple simulation program written based
on GTK+ it's reasonable to engage one main loop for windowing and the
other for simulation processing which results are shown in a window. Am
I right? But what about context? Should it be the one main or is it
better to
Also, worth differentiating between 1 main loop per thread + multiple
threads, and multiple recursive main loops per thread.
Modal dialogs involve a recursive main loop, but it runs in the same thread
as the normal main loop does (since it runs "inside" the "real" main loop).
An application like
Dialogs, for example, have their own main loop.
Generally, though, you will have one main loop (gtk's loop) even for
multiple windows in your app.
On Fri, May 6, 2016 at 4:11 PM, Krzysztof wrote:
> Is there a reason to have more than one MainContext or more than one
>
Is there a reason to have more than one MainContext or more than one
MainLoop? Or is it more appropriate to add event handlers to one
application main loop (I mean GtkApplication)?
--
Regards
Krzysztof J.
___
gtk-list mailing list
gtk-list@gnome.org