Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old July 18th, 2005, 06:39 PM
StvB
Guest
 
Posts: n/a
Default TreeNode End of Editing Event

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?










  #2  
Old July 18th, 2005, 06:46 PM
StvB
Guest
 
Posts: n/a
Default Re: TreeNode End of Editing Event

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()

--------------
wxTreeEvent::GetLabel
const wxString& GetLabel() const

returns the label if the event was a begin or end edit label event.

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


"StvB" <mesteve_bpleaseremovethis@hotmail.com> wrote in message
news:rtdmd.44537$QJ3.18312@newssvr21.news.prodigy. com...[color=blue]
> 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?
>
>
>
>
>
>
>[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,414 network members.