Re: More on popups




Miguel de Icaza writes:
>I will require modal windows for some parts of the file manager, so I
>am happy to hear the rumors that Gtk now include a framework to do
>modal dialogs.  I am still trying to get some time to actually sit
>down and figure out what did change on gtk 970915.

The change to support modal dialogs is really a change in the behavior
of "gtk_grab_add". Previously, "gtk_grab_add" would specify a widget
that was to receive all "user" events such as key and button
presses. Even events destined for a child of the grab widget would be
redirected to the grab widget.

I modified the event dispatcher so that events destined for a child
of the grab widget will be passed along to that child and only events
destined for widgets that aren't children of the grab widget are
redirected to the grab widget. The result is that you can add a grab
to a toplevel window (a dialog) and only events destined for that
dialog or its children will get through. 

A simple example of this is the "buttons" test in "testgtk". Note that
the dialog is only modal in the user interface sense and still
requires callbacks from the event loop to be used. This can be avoided
by calling "gtk_main" recursively, but that is another topic.

Peter



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