Associate objects with Tix.Tree

W

Wolfram Kraus

Heyho!

I want to associate objects with the nodes of a Tix.Tree. Is this
possible, because the following example won't work:

--8<-- Cut here -------------------------
import Tix

class C:
pass

root = Tix.Tk()
top = Tix.Frame(root, relief=Tix.RAISED, bd=1)
tixtree = Tix.Tree(top)
tixtree.pack(expand=1, fill=Tix.BOTH, padx=10, pady=10, side=Tix.LEFT)
c=C()
print c
tixtree.hlist.add(c,
itemtype=Tix.IMAGETEXT,
text='foo',
image=tixtree.tk.call('tix', 'getimage', 'folder'))
tixtree.setmode(c, 'open')
root.mainloop()
--8<-- Cut here -------------------------

Can this somehow be done?

TIA,
Wolfram
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top