summaryrefslogtreecommitdiffstats
path: root/library/xmfbox.tcl
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/xmfbox.tcl
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/xmfbox.tcl')
-rw-r--r--library/xmfbox.tcl16
1 files changed, 9 insertions, 7 deletions
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} {