[pygtk] Dialog Lifecycle?

Darren Hart darren at dvhart.com
Wed Mar 19 15:33:57 WST 2008


I'm trying to add a dialog bound to a menu item.  I created the UI in
glade.  I use the glade.XML.get_widget() to get the dialog, and then show()
it from the menuitem action handler.  Then I hide it when the dialog
response handler receives RESPONSE_OK.  If I CLOSE the dialog however (from
the window manager X button) I see gtk.RESPONSE_DELETE_EVENT, and after that
I can no longer use glade.XML.get_widget() to retrieve my dialog.  It has
been destroyed.

1) Is it really necessary to destroy and recreate the dialolg, rather than
just show/hide?
2) If so, is the only way to recreate the dialog to re-read the glade file,
passing it the dialog name as the third param?

Also, the dialog is visible by default, so part of my start -up sequence is
to hide it.... but you can see the wm animation... so I don't think that is
the right way either.

I get the feeling I'm swimming upstream here, so if someone can set me
straight on how to properly use dialog boxes, I would be most appreciative.

Thanks,

-- =

Darren Hart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20080318/42c63e58/at=
tachment.htm


More information about the pygtk mailing list