summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2000-09-30 18:00:12 (GMT)
committerdrh <drh@noemail.net>2000-09-30 18:00:12 (GMT)
commit34b9d271ce2605bf35032ebf369ba6d5220674af (patch)
tree3f7e0d7f2489d9f051a0a6718b389e5a574438ff
parent057320722838ba3f48193179ea9b840e3691d649 (diff)
downloadtk-34b9d271ce2605bf35032ebf369ba6d5220674af.zip
tk-34b9d271ce2605bf35032ebf369ba6d5220674af.tar.gz
tk-34b9d271ce2605bf35032ebf369ba6d5220674af.tar.bz2
When a dialog box (ex: tk_messageBox) pops up while
another application is holding the grab, the "grab" command fails and the dialog box is inoperative. "catch" the "grab" to prevent this. FossilOrigin-Name: eb8ebc726eb281925b6961193cd6b7526a5fe122
-rw-r--r--library/tk.tcl6
1 files changed, 4 insertions, 2 deletions
diff --git a/library/tk.tcl b/library/tk.tcl
index b43f4df..2e872a9 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.24 2000/06/30 20:19:06 ericm Exp $
+# RCS: @(#) $Id: tk.tcl,v 1.25 2000/09/30 18:00:12 drh Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
@@ -108,7 +108,9 @@ proc ::tk::SetFocusGrab {grab {focus {}}} {
if {[winfo exists $oldGrab]} {
lappend data [grab status $oldGrab]
}
- grab $grab
+ # The "grab" command will fail if another application
+ # already holds the grab. So catch it.
+ catch {grab $grab}
if {[winfo exists $focus]} {
focus $focus
}