From 8db7bc8b95f4cd5d184dfb92a9750cb8dbf68928 Mon Sep 17 00:00:00 2001 From: drh Date: Sat, 30 Sep 2000 18:00:12 +0000 Subject: 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. --- library/tk.tcl | 6 ++++-- 1 file 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 } -- cgit v0.12