Re: set_modal/grab_add



Note that every widget displayed on the screen must have
a GtkWindow as the toplevel widget on the heirarchy
or GTK+ will not work correctly.

I think thats exactly what I needed to hear.

I'm trying to display a GtkKeyboard 
(my custom widget for a touchscreen keyboard)
as a popup. I construct it inside a toplevel 
GtkWindow useing glade. then I try to use it as
a popup with gtk_widget_show().

This means that modal or not ... no widgets can overlap
exept for the GtkWindow.

Thanks alot, If the above is correct
(I'm quite sure now) than I'll figure
something out.

        -Tristan


Owen Taylor wrote:

Tristan Van Berkom <vantr touchtunes com> writes:

      While I sift through the source someone might
be able to tell me:

Will:

      gtk_grab_add(GTK_WIDGET(window));

do the same as:

      gtk_window_set_modal(window, TRUE);

exept for the the window not having its "modal"
property set ?

set_modal() is essentially "gtk_grab when the window
is shown, ungrab when it is hidden."

There are a few extra tweaks based on the modal flag -- e.g.,
if you call gtk_window_set_modal() on a GtkFileSelection
object, it will properly make child dialogs modal sa well.

the reason for this question is that I would like
to "set_modal" on my own custom widget which
doesn't inherit from GtkWindow. (I know I could
give it it's own window but I'll eliminate alot
of extra code this way.)

Note that every widget displayed on the screen must have
a GtkWindow as the toplevel widget on the heirarchy
or GTK+ will not work correctly.

Regards,
                                        Owen
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



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