[Patches] [ python-Patches-443626 ] TreeWidget cancellation problem

noreply@sourceforge.net noreply@sourceforge.net
Thu, 09 Aug 2001 10:58:05 -0700


Patches item #443626, was opened at 2001-07-22 15:12
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=443626&group_id=5470

Category: IDLE
Group: 2.0.1 bugfix
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Guido van Rossum (gvanrossum)
Summary: TreeWidget cancellation problem

Initial Comment:

TreeWidget was supposed to cancel editing when the 
user presses an Escape key.  An entry was accepted 
anyways.
Offending funcion : TreeWidget.TreeNode.edit_cancel

Here is the origial:

    def edit_cancel(self, event=None):
        self.drawtext()
        self.canvas.focus_set()


Here is the fix:

    def edit_cancel(self, event=None):
        try:
            self.entry.destroy()
            del self.entry
        except AttributeError:
            return
        self.drawtext()
        self.canvas.focus_set()

The bug arose mainly because the edit_cancel did not 
destroy the Tkinter.Entry widget as part of the 
cancellation process.  This obviously fixes that...



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

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=443626&group_id=5470