Re: blocking, non-modal dialog?

On Monday 29 August 2005 14:03, Allin Cottrell wrote:
Sorry, I wasn't very clear.  There is only one gtk process in play.
This is what I mean:

1 My app's main window is displayed
2 The user opens a blocking dialog
3 Without closing the dialog box, the user deletes the main
   window via the window manager ('X')
4 Deletion of the main window triggers gtk_main_quit(), but at
   this point gtk_main_level = 2.
5 The blocking dialog remains open

If I set up the dialog with the main window as parent, and
call gtk_window_set_destroy_with_parent() on the blocking dialog,
then at step 5 the blocking dialog disappears OK, but it
seems that gtk_main_level remains at 1, in the background:
the application is not actually terminated.

My workaround at present is to record whether a blocking dialog is
open: when the user attempts to delete the main window, I check
for the presence of such a dialog and if there is one, I raise it
instead of deleting the main window.

Yes, I see the problem.  Instead of raising the dialog you could of course 
call gtk_main_quit() again to balance up the recursive calls to gtk_main() 
and so terminate the program by coming out of the last GMainContext program 


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