TreeNode End of Editing Event

StvB mesteve_bpleaseremovethis at hotmail.com
Wed Nov 17 22:06:44 EST 2004


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 at hotmail.com> wrote in message 
news:rtdmd.44537$QJ3.18312 at newssvr21.news.prodigy.com...
> 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?
>
>
>
>
>
>
> 





More information about the Python-list mailing list