Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
574 views
in Technique[技术] by (71.8m points)

gtk - GtkDialog mapped without a transient parent

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...