summaryrefslogtreecommitdiffstats
path: root/library/dialog.tcl
diff options
context:
space:
mode:
authorhobbs <hobbs>2005-10-05 04:14:19 (GMT)
committerhobbs <hobbs>2005-10-05 04:14:19 (GMT)
commit369a19bc7a32c8f8b61380d81e82fdc123c83290 (patch)
tree7be4916ee9e08c24222752d1147fc328977c48c1 /library/dialog.tcl
parenta7488342ba85d46077548e4de460c9e02935aea4 (diff)
downloadtk-369a19bc7a32c8f8b61380d81e82fdc123c83290.zip
tk-369a19bc7a32c8f8b61380d81e82fdc123c83290.tar.gz
tk-369a19bc7a32c8f8b61380d81e82fdc123c83290.tar.bz2
* library/dialog.tcl (::tk_dialog): add tkwait visibility before
grab. [Bug 1216775]
Diffstat (limited to 'library/dialog.tcl')
-rw-r--r--library/dialog.tcl25
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)