Re: main loop



Dnia 09-07-2005, sob o godzinie 15:34 +0200, The Saltydog napisał:
This error means you don't have any mainloop running that could be
stopped. Seems like you're running gtk_main_quit() too many times, you
should rather exit the process (via exit() or return from main()).

It is due to the fact that I am running a time-demanding deep routine
in main before executing gtk-main. Then, from the routine I am
executing

while (gtk_events_pending()) { gtk_main_iteration(); }

so that the GUI comes up. But at that point, if I click on exit
(gtk-main-quit()) before the subroutine has ended, I got the main-loop
eror.

Then, if you are running it before main loop is setup, you can't call
gtk_main_quit(). I'd suggest you first run your subroutine, only after
it has finished setup callbacks which can invoke gtk_main_quit(), and
then run proper mainloop. And yes, setting things up so that quit can
happen cleanly even while in subroutine can be pretty painful, you may
need to play around with deferred function invocation and such to get
rid of warnings.

Cheers,
Maciej

-- 
Being really good at C++ is like being really good at using rocks to
sharpen sticks. (Thant Tessman)
--------
Maciej Katafiasz <ml mathrick org>
http://mathrick.org




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