[Python.NET] binding python objects to treenodes

Previous Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Python.NET] binding python objects to treenodes

guy_home2000
Hello,

Is there a way to bind a python object to a treeView node? I have the following
treenode based class:

class dataNode(WinForms.TreeNode):

     def __init__(self,name,total):
         self.Text = name
         self.Total = total

And I add the node as such:

self.treeView1.Nodes.Add(dataNode("testnode",3))

But when I try and access the attributes it doesn't work?

    for node in self.treeView1.Nodes:
       print node.Total

Or should I keep the nodes in a list and access by index?

Any help appeciated.

Guy



_________________________________________________
Python.NET mailing list - [hidden email]
http://mail.python.org/mailman/listinfo/pythondotnet