Associate objects with Tix.Tree

Discussion in 'Python' started by Wolfram Kraus, Jan 15, 2005.

  1. 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
    Wolfram Kraus, Jan 15, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stub

    B tree, B+ tree and B* tree

    Stub, Nov 12, 2003, in forum: C Programming
    Replies:
    3
    Views:
    10,109
  2. Replies:
    0
    Views:
    278
  3. Tim N. van der Leeuw

    Tix Tree / HList widget?

    Tim N. van der Leeuw, Jun 19, 2006, in forum: Python
    Replies:
    0
    Views:
    616
    Tim N. van der Leeuw
    Jun 19, 2006
  4. Sorin Schwimmer

    Tix Tree open/close issue

    Sorin Schwimmer, Jul 13, 2006, in forum: Python
    Replies:
    1
    Views:
    374
    Rob Williscroft
    Jul 14, 2006
  5. Veloz
    Replies:
    3
    Views:
    357
    James Kanze
    Sep 23, 2007
Loading...

Share This Page