TreeNode End of Editing Event

S

StvB

Hi,
I just started implementing adding a new node to an existing tree.

In these statements, I add the node itself and attach the
"end of editing" event handler to the event
--------
id = self.tree.AppendItem(self.root,'New Item Node',-1,-1)
EVT_TREE_END_LABEL_EDIT(self.tree, treeID, self.OnEndEdit)
---------
But when I respond to the EVT_TREE_END_LABEL_EDIT event, I don't get the
new label when you change it:

The event handler:
-------------
def OnEndEdit(self,event):
item=event.GetItem()
s = self.tree.GetItemText(item) # for debugging

------------

The 's' variable shows the original label (set above) which is 'New Item
Node'. Should it not show the new text after entering and then press Enter
key?


Am I going about this the wrong way?
 
S

StvB

Here's where I loused up: I didn't continue reading the documentation
carefully.

You don't use GetItemText(). Instead, in either a BEGIN_LABEL_EDIT event,
or a END_LABEL_EDIT (which I need to use) event, you use: GetLabel()
 

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

No members online now.

Forum statistics

Threads
474,211
Messages
2,571,092
Members
47,693
Latest member
david4523

Latest Threads

Top