Need help with Wxpython

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • azrael

    Need help with Wxpython

    I need to implement a tree which will append a root. Any other node in
    the tree will be triggered when a button is pressed.
    I created the button, all the needed events, tree and a root. But when
    I want to append a node pressing the button I don't know How.

    My idea is using the wx.EVT_TREE_SEL _CHANGED event somehow get The ID
    or something of the selected node, so I could know Where to append the
    his child. I need the ID for the appenditem method. But HOW TO GET THE
    ID FOR THE PARENT.

    PLEASE SOME HELP, I CAN'T FIND THE NEEDED METHOD
  • Mike Driscoll

    #2
    Re: Need help with Wxpython

    On Oct 14, 9:00 am, azrael <jura.gro...@gm ail.comwrote:
    I need to implement a tree which will append a root. Any other node in
    the tree will be triggered when a button is pressed.
    I created the button, all the needed events, tree and a root. But when
    I want to append a node pressing the button I don't know How.
    >
    My idea is using the wx.EVT_TREE_SEL _CHANGED event somehow get The ID
    or something of the selected node, so I could know Where to append the
    his child. I need the ID for the appenditem method. But HOW TO GET THE
    ID FOR THE PARENT.
    >
    PLEASE SOME HELP, I CAN'T FIND THE NEEDED METHOD
    The demo seems to do have an example that does this. See the
    "TreeMixin" under the "More Windows/Controls" section. If you don't
    have the demo, you can get it here: http://wxpython.org/download.php

    I recommend the wxPython mailing list for questions about wxPython
    too. I'm sure someone on there could tell you how to do it without the
    mixin: http://wxpython.org/maillist.php

    Mike

    Comment

    • azrael

      #3
      Re: Need help with Wxpython

      Seen it already but looks to complicated. Someone knows a better way?

      Comment

      • Mike Driscoll

        #4
        Re: Need help with Wxpython

        On Oct 14, 9:36 am, azrael <jura.gro...@gm ail.comwrote:
        Seen it already but looks to complicated. Someone knows a better way?
        What about the tree control's GetSelection method? That seems to
        return the TreeItemId.

        Mike

        Comment

        Working...