diff options
author | drh <drh@sqlite.org> | 2000-09-30 18:00:12 (GMT) |
---|---|---|
committer | drh <drh@sqlite.org> | 2000-09-30 18:00:12 (GMT) |
commit | 8db7bc8b95f4cd5d184dfb92a9750cb8dbf68928 (patch) | |
tree | 3f7e0d7f2489d9f051a0a6718b389e5a574438ff /library | |
parent | 8432fe13edf65bc1a15b64fc6cff20397391e9fe (diff) | |
download | tk-8db7bc8b95f4cd5d184dfb92a9750cb8dbf68928.zip tk-8db7bc8b95f4cd5d184dfb92a9750cb8dbf68928.tar.gz tk-8db7bc8b95f4cd5d184dfb92a9750cb8dbf68928.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.
Diffstat (limited to 'library')
-rw-r--r-- | library/tk.tcl | 6 |
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 } |