Re: gtk_main problematic writes:
> I'm probably stupid, but I can't find how to handle correctly this
> case:

No, this case is very hard. :-) Almost every GTK and GNOME application
has exactly this bug.
> 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.
> What is the best solution to prevent this ?

The best solution is for GTK to automatically ignore delete_event (and
maybe set the window manager hint saying it's being ignored) while 
a GtkWindow does not have the grab, and another window does have the
grab. But this won't help with GTK+ 1.2, though I hope the change can
go in 1.4.
All you can do with 1.2 really is install a delete_event handler
returning TRUE to ignore the delete event on every window but the
modal one when you enter your second gtk_main(), and then remove the
delete_event handlers when you exit the second gtk_main(). I know it's
horrible - that's why it needs to be fixed in GTK. :-(


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