Ed Leafe wrote:
> On Sep 6, 2008, at 10:59 AM, Paul McNett wrote:
>
>> So there's no use-case for creating a set of dNodes and adding them
>> to a
>> tree? Like with dColumn/dGrid?
>
> No, because nodes cannot exist independent of each other; they must
> exist in the context of the tree. On those occasions where you want to
> define a subclass, you can do:
>
> ndCls = dabo.ui.dTreeView.getBaseNodeClass()
> class SubNode(ndCls):
> def afterInit(self):
> ...do some stuff
>
> tree = dabo.ui.dTreeView(self, NodeClass=SubNode)
>
> I originally had the class completely hidden, but the Class Designer
> forced me to expose it (and the other internal classes I mentioned) in
> order to form the mixed-in classes that would work with the
> introspection required for saving and modifying them. The danger in
> dealing with the nodes as a class is that a lot of the 'magic' that
> goes into managing them and the wxPython implementation of trees lives
> in the dTreeView class itself. In the process of trying to manipulate
> them in the Class Designer I ran into a lot of places where a
> seemingly minor change caused the tree to stop working (at best), and
> sometimes a segfault.
Ok, I'm just thinking out loud here, but I like how we designed dGrid to
expose dColumn as a full and complete class, even though we had to do a
lot of work underneath to hide the internals from the interface.
Much or all of what you say about dNode seems to apply to dColumn too
(can only exist in the context of a dGrid; the magic of their use lies
in dGrid, etc.).
I can easily and cleanly subclass dColumn, and instantiate that to add
to the dGrid.
You already have a case for needing the dNode class exposed, so why not
be consistent with our other main control that is made up of child objects?
Again, just thinking out loud, but how is:
{{{
ndCls = dabo.ui.dTreeView.getBaseNodeClass()
class SubNode(ndCls):
}}}
better than:
{{{
class SubNode(dabo.ui.dNode):
}}}
?
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]