summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2005-10-05 04:14:18 (GMT)
committerhobbs <hobbs@noemail.net>2005-10-05 04:14:18 (GMT)
commitcc4a6dc10b647a6021029b052455c91293e24284 (patch)
tree7be4916ee9e08c24222752d1147fc328977c48c1
parentee49e0e4f62466eb9d8ab7394f7738034bebf423 (diff)
downloadtk-cc4a6dc10b647a6021029b052455c91293e24284.zip
tk-cc4a6dc10b647a6021029b052455c91293e24284.tar.gz
tk-cc4a6dc10b647a6021029b052455c91293e24284.tar.bz2
* library/dialog.tcl (::tk_dialog): add tkwait visibility before
grab. [Bug 1216775] FossilOrigin-Name: c75a9d67971f7032430baca403fab509eb49c774
-rw-r--r--ChangeLog3
-rw-r--r--library/dialog.tcl25
2 files changed, 16 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 8f9d3f4..ff3ed58 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2005-10-04 Jeff Hobbs <jeffh@ActiveState.com>
+ * library/dialog.tcl (::tk_dialog): add tkwait visibility before
+ grab. [Bug 1216775]
+
* win/tkWinDialog.c (ChooseDirectoryValidateProc): reset stored
path to "" if it doesn't exist and -mustexist is true. [Bug 1309218]
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)