Associate objects with Tix.Tree

Wolfram Kraus the_schlops at yahoo.de
Sat Jan 15 12:51:29 EST 2005


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



More information about the Python-list mailing list