ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> wxpython-users
wxpython-users
[wxpython-users] CustomTreeCtrl Edit Labels (to Andrea)
by Kyle W Rickey other posts by this author
May 8 2008 1:33PM messages near this date
Re: [wxpython-users] Why can't I run this code? | [wxpython-users] Re: Compiling and .exe
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
_______________________________________________
wxpython-users mailing list
wxpython-users@[...].org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved