Re: [gtk-list] Toplevel window types.



jca <jca@mail.phm.vcu.edu> writes:
> What's the functional difference between a
> GTK_WINDOW_TOPLEVEL,
> GTK_WINDOW_DIALOG, and
> GTK_WINDOW_POPUP?
> 
>   I know what they are, but will they behave very differently if I use
> one flag instead of the other?
> 
>   E.G, are dialog and popup set to "always on top"?
> Do dialog and popup link back to the main toplevel in some way, to pass
> data?
> 

Exact behavior is a bit window-manager-dependent.

GTK_WINDOW_POPUP is for menus and tooltips, not "normal" windows, it
will behave very oddly if you use it for normal windows. Notably these
windows are not window-managed.

Some window managers will handle GTK_WINDOW_DIALOG a bit differently,
I think because GDK sets the window transient for the root window.  To
get optimal dialog behavior you need to call
gtk_window_set_transient_for() to set your dialog transient for the
appropriate application window though.

Normally you always want GTK_WINDOW_TOPLEVEL, because if you want
dialog you're using GtkDialog or GnomeDialog and if you want 
popup you're using GtkMenu or GtkTooltips. So if GTK were being
designed from scratch today I'd say the argument to gtk_window_new()
is fairly pointless.

Havoc



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