Re: [gtk-list] Re: non-exiting gtk_exit()




Paul Barton-Davis <pbd@op.net> writes: 
> >		     Still, I would call this code broken; I'm not sure
> >how it would behave if you had a modal dialog up, for example. A
> >better solution is to never call gtk_main() recursively, and instead
> >explicitly create a new GMainLoop and g_main_run()/g_main_quit() that
> >main loop.
> 
> this seems a little perverse when a quick inspection of gtk_main() as
> well as the various next-step-beyond-tutorial docs on GTK frequently
> mention this nice ability to use it recursively. they don't happen to
> mention that its a code motel: functions check in, but they can't
> check out :)
> 

I think over time it became clear that the stack of GMainLoop
maintained by gtk_main() is sort of broken; using gtk_main* at all
isn't even necessary, you can simply use the glib main loop directly
(GTK quit/init functions won't work, but who cares). The docs are
trailing the current opinion on this, I guess. And of course
gtk_main() is harmless most of the time.

Havoc



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