I am working with a dynamic interface in pyGTK. I have a dictionary
containing many different widgets, and after certain events I want to
check the state of those widgets. The only problem is that sometimes the
container of those widgets is destroyed, therefore destroying the inner
widgets, but they are not of course removed from the widget tree
(dictionary).

        I need to iterate through the keys in the widget tree, and read the
state of the visible widgets, such as the GtkEntry of GtkCombos.
However, as I can't seem to find a method for safely trying to do so.

        If I simply try to access each widget, and put the actual access call
inside a try/except statement, the program still crashed with a
"Gtk-CRITICAL **: file gtkobject.c: line 1162 (gtk_object_ref):
assertion `GTK_IS_OBJECT (object)' failed." message.

        I can check to see if the key for a widget is a GtkCombo with
"isinstance(self.eventTree[ each ], gtk.GtkCombo)" but I can't check the
entry of a destroyed combo with "isinstance(self.eventTree[ each
].entry, gtk.GtkEntry)" without the program crashing.

        Is there a "safe" way to try to accomplish what I need?


-- 
Steve Castellotti
Systems Programmer
School of Arts and Sciences, University of Pennsylvania

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to