diff options
author | hobbs <hobbs> | 2002-07-25 20:36:05 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2002-07-25 20:36:05 (GMT) |
commit | 53620f70e97baed98b6eb26b9130bf33cba6a3a6 (patch) | |
tree | e70e2f5e577b1210c8fd3b4027c3416c301fa8cf | |
parent | 75f478183adb7df3293a47f206b923fb76533cd3 (diff) | |
download | tk-53620f70e97baed98b6eb26b9130bf33cba6a3a6.zip tk-53620f70e97baed98b6eb26b9130bf33cba6a3a6.tar.gz tk-53620f70e97baed98b6eb26b9130bf33cba6a3a6.tar.bz2 |
* library/tk.tcl (RestoreFocusGrab): handle the case where the
FocusGrab info is not set. [Bug #553283]
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | library/tk.tcl | 10 |
2 files changed, 12 insertions, 3 deletions
@@ -1,3 +1,8 @@ +2002-07-25 Jeff Hobbs <jeffh@ActiveState.com> + + * library/tk.tcl (RestoreFocusGrab): handle the case where the + FocusGrab info is not set. [Bug #553283] + 2002-07-24 Jeff Hobbs <jeffh@ActiveState.com> * tests/canvas.test: added canvas-14.[1-6] diff --git a/library/tk.tcl b/library/tk.tcl index cf13cba..392c96d 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -3,7 +3,7 @@ # Initialization script normally executed in the interpreter for each # Tk-based application. Arranges class bindings for widgets. # -# RCS: @(#) $Id: tk.tcl,v 1.20.2.2 2001/10/19 17:33:00 hobbs Exp $ +# RCS: @(#) $Id: tk.tcl,v 1.20.2.3 2002/07/25 20:36:05 hobbs Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -128,8 +128,12 @@ proc ::tk::SetFocusGrab {grab {focus {}}} { # proc ::tk::RestoreFocusGrab {grab focus {destroy destroy}} { set index "$grab,$focus" - foreach {oldFocus oldGrab oldStatus} $::tk::FocusGrab($index) { break } - unset ::tk::FocusGrab($index) + if {[info exists ::tk::FocusGrab($index)]} { + foreach {oldFocus oldGrab oldStatus} $::tk::FocusGrab($index) { break } + unset ::tk::FocusGrab($index) + } else { + set oldGrab "" + } catch {focus $oldFocus} grab release $grab |