Need help with Wxpython

A

azrael

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
 
M

Mike Driscoll

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
 
M

Mike Driscoll

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
 

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,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top