diff options
author | hobbs <hobbs> | 2005-10-05 04:14:19 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2005-10-05 04:14:19 (GMT) |
commit | 658f12137942f74af23c43297e2a0e89d0e3fe9b (patch) | |
tree | 7be4916ee9e08c24222752d1147fc328977c48c1 /library | |
parent | 5922750b410113382cfe956f97a7912273737172 (diff) | |
download | tk-658f12137942f74af23c43297e2a0e89d0e3fe9b.zip tk-658f12137942f74af23c43297e2a0e89d0e3fe9b.tar.gz tk-658f12137942f74af23c43297e2a0e89d0e3fe9b.tar.bz2 |
* library/dialog.tcl (::tk_dialog): add tkwait visibility before
grab. [Bug 1216775]
Diffstat (limited to 'library')
-rw-r--r-- | library/dialog.tcl | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/library/dialog.tcl b/library/dialog.tcl index 2a66619..3d64b4d 100644 --- a/library/dialog.tcl +++ b/library/dialog.tcl @@ -3,7 +3,7 @@ # This file defines the procedure tk_dialog, which creates a dialog # box containing a bitmap, a message, and one or more buttons. # -# RCS: @(#) $Id: dialog.tcl,v 1.14.2.1 2003/10/22 15:22:07 dkf Exp $ +# RCS: @(#) $Id: dialog.tcl,v 1.14.2.2 2005/10/05 04:14:19 hobbs Exp $ # # Copyright (c) 1992-1993 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -63,7 +63,7 @@ proc ::tk_dialog {w title text bitmap default args} { # if {[winfo viewable [winfo toplevel [winfo parent $w]]] } { wm transient $w [winfo toplevel [winfo parent $w]] - } + } if {[string equal $tcl_platform(platform) "macintosh"] || [string equal [tk windowingsystem] "aqua"]} { @@ -93,10 +93,9 @@ proc ::tk_dialog {w title text bitmap default args} { label $w.msg -justify left -text $text pack $w.msg -in $w.top -side right -expand 1 -fill both -padx 3m -pady 3m - if {[string compare $bitmap ""]} { - if {([string equal $tcl_platform(platform) "macintosh"] - || [string equal [tk windowingsystem] "aqua"]) &&\ - [string equal $bitmap "error"]} { + if {$bitmap ne ""} { + if {($tcl_platform(platform) eq "macintosh" + || [tk windowingsystem] eq "aqua") && ($bitmap eq "error")} { set bitmap "stop" } label $w.bitmap -bitmap $bitmap @@ -165,14 +164,16 @@ proc ::tk_dialog {w title text bitmap default args} { set y 0 } wm maxsize $w [winfo screenwidth $w] [winfo screenheight $w] - wm geom $w +$x+$y + wm geometry $w +$x+$y wm deiconify $w + tkwait visibility $w + # 7. Set a grab and claim the focus too. set oldFocus [focus] set oldGrab [grab current $w] - if {[string compare $oldGrab ""]} { + if {$oldGrab ne ""} { set grabStatus [grab status $oldGrab] } grab $w @@ -198,11 +199,11 @@ proc ::tk_dialog {w title text bitmap default args} { bind $w <Destroy> {} destroy $w } - if {[string compare $oldGrab ""]} { - if {[string compare $grabStatus "global"]} { + if {$oldGrab ne ""} { + if {$grabStatus ne "global"} { grab $oldGrab - } else { - grab -global $oldGrab + } else { + grab -global $oldGrab } } return $Priv(button) |