summaryrefslogtreecommitdiffstats
path: root/library/tkfbox.tcl
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-10-22 10:12:56 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-10-22 10:12:56 (GMT)
commit6e54465f2ce23a6ce6f4e4395e8f1c4abe77c794 (patch)
tree5249cef7bde85d09ac0961141555654aa3adf74f /library/tkfbox.tcl
parentdaf41a1547accd08cb2e0a0ba22c735c7bef663e (diff)
downloadtk-6e54465f2ce23a6ce6f4e4395e8f1c4abe77c794.zip
tk-6e54465f2ce23a6ce6f4e4395e8f1c4abe77c794.tar.gz
tk-6e54465f2ce23a6ce6f4e4395e8f1c4abe77c794.tar.bz2
Deal with [Patch 2168768], so making the -typevariable option work consistently
with global variables (the only way it *can* work...)
Diffstat (limited to 'library/tkfbox.tcl')
-rw-r--r--library/tkfbox.tcl14
1 files changed, 8 insertions, 6 deletions
diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl
index 29fc665..b3c7156 100644
--- a/library/tkfbox.tcl
+++ b/library/tkfbox.tcl
@@ -10,7 +10,7 @@
# "Directory" option menu. The user can select files by clicking on the
# file icons or by entering a filename in the "Filename:" entry.
#
-# RCS: @(#) $Id: tkfbox.tcl,v 1.74 2009/04/14 18:09:50 dkf Exp $
+# RCS: @(#) $Id: tkfbox.tcl,v 1.75 2009/10/22 10:12:57 dkf Exp $
#
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
#
@@ -172,9 +172,11 @@ proc ::tk::dialog::file:: {type args} {
# Default type and name to first entry
set initialtype [lindex $data(-filetypes) 0]
set initialTypeName [lindex $initialtype 0]
- if {($data(-typevariable) ne "")
- && [uplevel 1 [list info exists $data(-typevariable)]]} {
- set initialTypeName [uplevel 1 [list set $data(-typevariable)]]
+ if {$data(-typevariable) ne ""} {
+ upvar #0 $data(-typevariable) typeVariable
+ if {[info exists typeVariable]} {
+ set initialTypeName $typeVariable
+ }
}
foreach type $data(-filetypes) {
set title [lindex $type 0]
@@ -1133,8 +1135,8 @@ proc ::tk::dialog::file::Done {w {selectFilePath ""}} {
&& [info exists data(-filetypes)] && [llength $data(-filetypes)]
&& [info exists data(filterType)] && $data(filterType) ne ""
} then {
- upvar 4 $data(-typevariable) initialTypeName
- set initialTypeName [lindex $data(filterType) 0]
+ upvar #0 $data(-typevariable) typeVariable
+ set typeVariable [lindex $data(filterType) 0]
}
}
bind $data(okBtn) <Destroy> {}