Andrea, in your CustomTreeCtrl, class TreeTextCtrl you have the
following function:
def OnKillFocus(self, event):
"""Handles the wx.EVT_KILL_FOCUS event for TreeTextCtrl."""
# I commented out those lines, and everything seems to work
fine.
# But why in the world are these lines of code here? Maybe GTK
# or MAC give troubles?
## if not self._finished and not self._aboutToFinish:
···
##
## # We must finish regardless of success, otherwise we'll
get
## # focus problems:
##
## if not self.AcceptChanges():
## self._owner.OnRenameCancelled(self._itemEdited)
# We must let the native text control handle focus, too,
otherwise
# it could have problems with the cursor (e.g., in wxGTK).
event.Skip()
The current behavior causes the changes of a label edit NOT to be
accepted when you click on another item while still editing. After
uncommenting out those lines the changes will be kept upon focus lost.
On the windows platform, it seems to be standard that when the editor
loses focus, it retains it's changes (tested renaming a file in windows
explorer). I'm not sure about other os's though.
At any rate, this is something I wanted for my application and thought
I'd share my discovery. Tested on WinXP, wxpython 2.8.7.1.
-Kyle Rickey