summaryrefslogtreecommitdiffstats
path: root/library
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
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')
-rw-r--r--library/tkfbox.tcl14
-rw-r--r--library/xmfbox.tcl14
2 files changed, 16 insertions, 12 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> {}
diff --git a/library/xmfbox.tcl b/library/xmfbox.tcl
index 803d0ec..e89041e 100644
--- a/library/xmfbox.tcl
+++ b/library/xmfbox.tcl
@@ -4,7 +4,7 @@
# Unix platform. This implementation is used only if the
# "::tk_strictMotif" flag is set.
#
-# RCS: @(#) $Id: xmfbox.tcl,v 1.33 2009/04/14 18:09:50 dkf Exp $
+# RCS: @(#) $Id: xmfbox.tcl,v 1.34 2009/10/22 10:12:57 dkf Exp $
#
# Copyright (c) 1996 Sun Microsystems, Inc.
# Copyright (c) 1998-2000 Scriptics Corporation
@@ -159,9 +159,11 @@ proc ::tk::MotifFDialog_FileTypes {w} {
# set data(fileType) $data(-defaulttype)
# Default type to first entry
set initialTypeName [lindex $data(-filetypes) 0 0]
- if {($data(-typevariable) ne "")
- && [uplevel 3 [list info exists $data(-typevariable)]]} {
- set initialTypeName [uplevel 3 [list set $data(-typevariable)]]
+ if {$data(-typevariable) ne ""} {
+ upvar #0 $data(-typevariable) typeVariable
+ if {[info exists typeVariable]} {
+ set initialTypeName $typeVariable
+ }
}
set ix 0
set data(fileType) 0
@@ -864,8 +866,8 @@ proc ::tk::MotifFDialog_ActivateSEnt {w} {
# Return selected filter
if {[info exists data(-typevariable)] && $data(-typevariable) ne ""
&& [info exists data(-filetypes)] && $data(-filetypes) ne ""} {
- upvar 2 $data(-typevariable) initialTypeName
- set initialTypeName [lindex $data(-filetypes) $data(fileType) 0]
+ upvar #0 $data(-typevariable) typeVariable
+ set typeVariable [lindex $data(-filetypes) $data(fileType) 0]
}
if {$data(-multiple) != 0} {