diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2009-10-22 10:27:58 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2009-10-22 10:27:58 (GMT) |
commit | da76bd4e71a3e8d17bd2b649d285e19a41f834b3 (patch) | |
tree | fe5c722a73092bba1b18f4ddcc412eaf45298fd1 /library/tkfbox.tcl | |
parent | 4da8735aec87cdbfff2fe507c403b4a4bf242f2e (diff) | |
download | tk-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/tkfbox.tcl')
-rw-r--r-- | library/tkfbox.tcl | 18 |
1 files changed, 10 insertions, 8 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> {} |