GtkDialog mapped without a transient parent

tobias47n9e picture tobias47n9e · Apr 26, 2015 · Viewed 85.6k times · Source

I have a GUI built in Glade (3.18) which is called by a Python 3 program (using PyGObject). I get a lot of warnings when running the program (Fedora 21) that say:

Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

How can I fix this warning? I tried filling in the field Transient for: main_window in Glade for all the dialog windows, but the warnings still appear.

Answer

andlabs picture andlabs · Apr 26, 2015

You fix this warning by giving the GtkDialog a parent to be modal to. The relevant functions are gtk_window_set_transient_for() (which sets this window to always be on top of, or transient for, another one) and optionally gtk_window_set_modal() to make it a modal dialog. This is ultimately what the various GtkDialog constructors do.