[pygtk] Core dump trying to get children of a Table widget
skip at pobox.com
skip at pobox.com
Thu Mar 23 21:57:39 WST 2006
Environment: Python 2.4.2, Gtk 2.6, PyGtk 2.6.?.
I like the inline completion in the Entry widget and want to set that
behavior in the FileChooserWidgets I create. Discovering where in the
hierarchy that widget resides is proving to be a challenge. I added a
little method to print the hierarchy of kids:
def print_kids(self, w, level=0):
print "%s%s" % (" "*level, w)
if hasattr(w, "get_children"):
for kid in w.get_children():
self.print_kids(kid, level+1)
and called it in the obvious way:
self.print_kids(self.save_as_dialog)
It generates an error trying to get the children of a Table widget then
dumps core:
<gtk.FileChooserDialog object (GtkFileChooserDialog) at 0x8a200f4>
<gtk.VBox object (GtkVBox) at 0x8a354b4>
<gtk.FileChooserWidget object (GtkFileChooserWidget) at 0x8a3548c>
<gtk.FileChooserDefault object (GtkFileChooserDefault) at 0x8a356e4>
<gtk.VBox object (GtkVBox) at 0x8a3570c>
<gtk.Table object (GtkTable) at 0x8a35784>
caught exception - quitting...
TypeError: Cannot create a consistent method resolution
order (MRO) for bases Editable, CellEditable, atk.ImplementorIface
Fatal signal: Segmentation Fault (SDL Parachute Deployed)
A slightly different formulation yields the same results:
def print_kids(self, w, level=0):
print "%s%s" % (" "*level, w)
try:
kids = w.get_children()
except AttributeError:
pass
else:
for kid in kids:
self.print_kids(kid, level+1)
I see no other obvious way to get the child widgets of a Table.
Is this a known bug? Fixed in a perhaps later version of 2.6 or in 2.8?
Thx,
Skip Montanaro
More information about the pygtk
mailing list