Re: gtk_main problematic



Owen Taylor <otaylor@redhat.com> writes:

> fjolliton@free.fr writes:
> 
> > I've a main widget displayed when program start, with a button than
> > open another window with it's own gtk_main loop (like a dialog box).
> > This last widget is made modal (either with gtk_widget_set_modal, or
> > with gtk_grab_add). (But this do not affect the behavior below, I
> > guess)
> > 
> > The problem: clicking window manager close button of the main window
> > terminate the gtk_main loop launched from the dialog box, then return
> > to "global" gtk_main loop.
> 
> While Havoc is right that GTK+ is deficient in this manner and
> handling this right is hard, you can at least not quit the
> wrong main loop by using g_main_run()/g_main_quit() instead
> of gtk_main(). Preventing this problem is the reason why
> g_main_run() takes a GMainLoop argument.

But with this solution, main window delete_event callback send a quit
message to the main GMainLoop instead of dialog loop, ok, this is
correcting the problem above, but after closing the dialog window, the
event loop process the quit message and quit the application. The
problem was moved :-)

What am I missing ?

-- 
Frederic Jolliton - <fjolliton@free.fr>
----- <http://fjolliton.free.fr/> -----



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