[python-gtk] problem with multiple inheritance
lambacck at gmail.com
Fri Jun 3 05:51:58 CEST 2005
One way to get around this would be to omit the TreeSortable interface
and use TreeModelSort to do the sorting instead. It doesn't look like
GenericTreeModel is designed to also support the TreeSortable
interface (you would need something like GenericTreeSortable since you
would need some magic to allow gobject inheritance from python.)
On 6/2/05, Greg Ewing <greg at cosc.canterbury.ac.nz> wrote:
> Taki Jeden wrote:
> > class view_tree_model(gtk.GenericTreeModel,gtk.TreeSortable):
> > raises a "TypeError: multiple bases have instance lay-out conflict"
> > Is this a bug in gtk, or python-gtk, or something?
> It's not a bug, it's a limitation of the way Python
> handles inheritance from built-in types. You can only
> inherit from more than one built-in type if they have
> compatible C structures, and it appears that the two
> you're trying to inherit from aren't compatible.
> You'll have to think of some way of doing whatever
> you're trying to do without inheriting from multiple
> gtk types.
> Greg Ewing, Computer Science Dept,
> University of Canterbury,
> Christchurch, New Zealand
lambacck at computer.org
More information about the Python-list