summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-07-25 20:36:54 (GMT)
committerhobbs <hobbs>2002-07-25 20:36:54 (GMT)
commit68487c77f3f2d8c274848d826056e66bac02cbf5 (patch)
tree08991eb7ba636d904963253fe953193f8c35da98
parentdc64cccd6cec898c113d106fd30d7af22180e2d0 (diff)
downloadtk-68487c77f3f2d8c274848d826056e66bac02cbf5.zip
tk-68487c77f3f2d8c274848d826056e66bac02cbf5.tar.gz
tk-68487c77f3f2d8c274848d826056e66bac02cbf5.tar.bz2
* library/tk.tcl (RestoreFocusGrab): handle the case where the
FocusGrab info is not set. [Bug #553283]
-rw-r--r--ChangeLog5
-rw-r--r--library/tk.tcl10
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index af5e69f..be1cdba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 165b56d..ea9e992 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.41 2002/06/10 00:15:42 a_kovalenko Exp $
+# RCS: @(#) $Id: tk.tcl,v 1.42 2002/07/25 20:36:55 hobbs Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
@@ -153,8 +153,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