From 5aa32dcd815719855c977ec975dd97e391cbf8b3 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 12 Oct 2016 18:34:49 +0000 Subject: Fixed [3588460fff] - -typevariable buggy in X11. Patch from Christian Gollwitzer --- library/tkfbox.tcl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl index a52465a..f73fdc5 100644 --- a/library/tkfbox.tcl +++ b/library/tkfbox.tcl @@ -310,6 +310,7 @@ proc ::tk::dialog::file::Config {dataName type argList} { # 5. Parse the -filetypes option # + set data(origfiletypes) $data(-filetypes) set data(-filetypes) [::tk::FDGetFileTypes $data(-filetypes)] if {![winfo exists $data(-parent)]} { @@ -1119,7 +1120,9 @@ proc ::tk::dialog::file::Done {w {selectFilePath ""}} { && [info exists data(filterType)] && $data(filterType) ne "" } then { upvar #0 $data(-typevariable) typeVariable - set typeVariable [lindex $data(filterType) 0] + set typeVariable [lindex $data(origfiletypes) \ + [lsearch -exact $data(-filetypes) $data(filterType)] 0] + } } bind $data(okBtn) {} -- cgit v0.12