summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-10-22 10:27:58 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-10-22 10:27:58 (GMT)
commitda76bd4e71a3e8d17bd2b649d285e19a41f834b3 (patch)
treefe5c722a73092bba1b18f4ddcc412eaf45298fd1 /library
parent4da8735aec87cdbfff2fe507c403b4a4bf242f2e (diff)
downloadtk-da76bd4e71a3e8d17bd2b649d285e19a41f834b3.zip
tk-da76bd4e71a3e8d17bd2b649d285e19a41f834b3.tar.gz
tk-da76bd4e71a3e8d17bd2b649d285e19a41f834b3.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.tcl18
-rw-r--r--library/xmfbox.tcl16
2 files changed, 19 insertions, 15 deletions
diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl
index c8009da..91acef3 100644
--- a/library/tkfbox.tcl
+++ b/library/tkfbox.tcl
@@ -11,7 +11,7 @@
# files by clicking on the file icons or by entering a filename
# in the "Filename:" entry.
#
-# RCS: @(#) $Id: tkfbox.tcl,v 1.68.2.2 2009/10/08 12:42:17 dkf Exp $
+# RCS: @(#) $Id: tkfbox.tcl,v 1.68.2.3 2009/10/22 10:27:58 dkf Exp $
#
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
#
@@ -888,9 +888,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 2 [list info exists $data(-typevariable)]]} {
- set initialTypeName [uplevel 2 [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]
@@ -1867,10 +1869,10 @@ proc ::tk::dialog::file::Done {w {selectFilePath ""}} {
}
}
if {[info exists data(-typevariable)] && $data(-typevariable) ne ""
- && [info exists data(-filetypes)] && [llength $data(-filetypes)]
- && [info exists data(filterType)] && $data(filterType) ne ""} {
- upvar 4 $data(-typevariable) initialTypeName
- set initialTypeName [lindex $data(filterType) 0]
+ && [info exists data(-filetypes)] && [llength $data(-filetypes)]
+ && [info exists data(filterType)] && $data(filterType) ne ""} {
+ 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 d79627a..048713e 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.31 2007/12/13 15:26:28 dgp Exp $
+# RCS: @(#) $Id: xmfbox.tcl,v 1.31.2.1 2009/10/22 10:27:58 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 4 [list info exists $data(-typevariable)]]} {
- set initialTypeName [uplevel 4 [list set $data(-typevariable)]]
+ if {$data(-typevariable) ne ""} {
+ upvar #0 $data(-typevariable) typeVariable
+ if {[info exist typeVariable]} {
+ set initialTypeName $typeVariable
+ }
}
set ix 0
set data(fileType) 0
@@ -863,9 +865,9 @@ 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]
+ && [info exists data(-filetypes)] && $data(-filetypes) ne ""} {
+ upvar #0 $data(-typevariable) typeVariable
+ set typeVariable [lindex $data(-filetypes) $data(fileType) 0]
}
if {$data(-multiple) != 0} {