Re: [pygtk] Does ctree.selection work?



On Thu, 16 Aug 2001, James Henstridge wrote:

That's weird.  ctree.selection should be calling
gtk_ctree_get_selection(), which should be treating the data members of
the list as GtkCTreeNodes.

It's quite odd, but I know the reason why it's happening. I wrote the
class as:

class CTree(gtk.GtkCTree, CList):
        pass

where CList is

class CList(gtk.GtkCList):
        pass

Because I wanted to take advantage of the features implemented in my
CList. This is broken inheritance, as I see it, since we have:

GtkCList -> GtkCTree -> CTree
     \                  /
       ----my CList----

I've been thinking of how to fix it, and the only way I see it is
providing a separate class to execute the actual extensions and call that
from my CList/CTree as a helper. Does that sound sane?

The code in GtkCTree.__getattr__ should be catching this lookup before it
recurses to GtkCList.__getattr__.

Right, but that broke when I did my inheritance foobar. Now I see why this
is complicated :)

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL





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