Hi Kyle,
···
On Dec 13, 2007 6:23 PM, Robin Dunn wrote:
Rickey, Kyle W wrote:
> I've got a binding to:
>
> self.Bind(wx.EVT_TREE_END_LABEL_EDIT, self.OnEndLabelEdit)
>
> def OnEndLabelEdit(self, event):
> print event.IsEditCancelled()
>
> However IsEditCancelled always evaluates to True. In what case does it
> become False? I would like to check so that when the user presses ESC,
> the label editing is cancelled, but when they press ENTER, the label is
> committed. The enter press works good thanks to some code from Robin
> Dunn:
>
> self.Bind(wx.EVT_NAVIGATION_KEY, self.OnTreeNavigate)
>
> def OnTreeNavigate(self, event):
> if self.tree.GetEditControl():
> self.tree.GetEditControl().AcceptChanges()
> self.tree.GetEditControl().StopEditing()This shouldn't be needed anymore in the latest version since it is using
the wx.WANTS_CAHRS style. Try removing it and then testing your
EndLabelEdit again. The IsEditCanceled seems to be doing the right
thing in the demo for me.
Yes, I have implemented this modification before the latest wxPython
release... it seems to do the right thing also for me. Can you please
try to upgrade to the latest wxPython and see if it works?
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/