ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] simple_dialog not truly modal in win32

From: Stephen Fisher <stephentfisher@xxxxxxxxx>
Date: Fri, 11 May 2007 13:42:33 -0700
On Fri, May 11, 2007 at 11:44:10AM -0700, Greg Bell wrote:

>   I'm working with the simple_dialog (gtk\simple_dialog.c) and even 
> though it is defined as being modal,

>   the calling code path continues execution after the dialog opens, 
> without waiting for the user to close the dialog. For example, if I 
> have the following code in some location:

I'm no win32 programmer, but I don't think setting the dialog to modal 
in GTK+ is meant to make it block execution on any platform.  According 
to http://developer.gnome.org/doc/API/2.0/gtk/GtkWindow.html#id2772272 :

"Sets a window modal or non-modal. Modal windows prevent interaction 
with other windows in the same application. To keep modal dialogs on top 
of main application windows, use gtk_window_set_transient_for() to make 
the dialog transient for the parent; most window managers will then 
disallow lowering the dialog below the parent."

If you want to wait for a dialog to be closed before another action is 
performed, try creating your own dialog and use callback functions to 
run the code you're waiting to run.  Check out the functions in 
gtk/dlg_utils.c as we have a number of functions that wrap around GTK+ 
functions for various reasons (making it easier to code, providing one 
function to wrap around separate code for GTK1 and GTK2, etc.)  Let us 
know if you have any further questions on how to use these functions.


Steve