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. Advertisements

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. Ramkumar Menon

    B+ Tree versus Ternary Search Tree

    Ramkumar Menon, Aug 16, 2005, in forum: Java
    Replies:
    2
    Views:
    1,847
    Roedy Green
    Aug 16, 2005
  2. Stub

    B tree, B+ tree and B* tree

    Stub, Nov 12, 2003, in forum: C Programming
    Replies:
    3
    Views:
    10,586
  3. Replies:
    0
    Views:
    364
  4. Tim N. van der Leeuw

    Tix Tree / HList widget?

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

    Tix Tree open/close issue

    Sorin Schwimmer, Jul 13, 2006, in forum: Python
    Replies:
    1
    Views:
    445
    Rob Williscroft
    Jul 14, 2006
  6. 7stud
    Replies:
    11
    Views:
    1,053
    Dennis Lee Bieber
    Mar 20, 2007
  7. Veloz
    Replies:
    3
    Views:
    490
    James Kanze
    Sep 23, 2007
  8. anne001
    Replies:
    1
    Views:
    337
Loading...