Re: Multithreaded gtk apps



On 2013-01-14 09:53, Phillip Susi wrote:
> My other thought was to acquire the main context and run the main loop
> in the background thread for the duration of the dialog box, but it
> seems that the foreground thread must willingly release the main
> context rather than have it temporarily stolen while it is blocked.

If I understand correctly, I tried something like that once too, using
something like the example from the manual:

  while (gtk_events_pending ())
      gtk_main_iteration ();

The problem I ran into was that I ended up running random stuff half way
though my function, which was a nightmare to figure out. For example,
what if if the use clicks the close button during that main loop and
destroys the GUI.. then the while loop exists and I'm half way though a
function with a bunch of dead widgets.

I think that's pretty much what gtk_dialog_run does though, but I don't
think I've ever used that function.

Attachment: pgpPMNDNUgcL6.pgp
Description: PGP signature



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