[Glade-users] Glade dialogs



I'm finding Glade dialogs a little confusing. I want a modal dialog box 
which appears centred over my app window. I can do this by creating the 
dialog in my code but I've designed a couple of more complex dialogs in 
Glade and I can work out how to get the same behaviour for these 
dialogs. The problem seems to be that my Glade dialogs don't have a 
parent window so they pop up in all sorts of funny places.

To display my Glade dialog (using Python) I do this:

        tree = gtk.glade.XML(GLADEFILE, "config_dialog")
        dialog = tree.get_widget("config_dialog")
        dialog.run()

Calling 'dialog.get_parent()' returns Python's 'None', essentially 
null, so I tried  'dialog.set_parent(app_window)' which fails with the 
following output:

(view-editor.py:1749): Gtk-CRITICAL **: file gtkwidget.c: line 3818 
(gtk_widget_set_parent): assertion `!GTK_WIDGET_TOPLEVEL (widget)' 
failed

The nearest I can get to what I want is by doing this 
'dialog.set_transient_for(app_window)', but the behaviour is slightly 
different to my regular dialogs.

No idea what to do. Help?










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