summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogel@noemail.net>2016-10-21 13:51:49 (GMT)
committerfvogel <fvogel@noemail.net>2016-10-21 13:51:49 (GMT)
commit9db68840674e7ec5185bc19ccedb21ecca0d62c2 (patch)
tree4e36e36b92f4f2836b87ce0b6eade1b056e2cffa
parentc9f4de1513c1c33e8c7d10d5560d86f54d29a721 (diff)
downloadtk-9db68840674e7ec5185bc19ccedb21ecca0d62c2.zip
tk-9db68840674e7ec5185bc19ccedb21ecca0d62c2.tar.gz
tk-9db68840674e7ec5185bc19ccedb21ecca0d62c2.tar.bz2
Fixed [3588460fff] - -typevariable buggy in X11, this time when tk_strictMotif is true.
FossilOrigin-Name: 374cb2049bdcbd32282e119543c789013798fcc0
-rw-r--r--library/xmfbox.tcl16
-rw-r--r--tests/filebox.test6
2 files changed, 6 insertions, 16 deletions
diff --git a/library/xmfbox.tcl b/library/xmfbox.tcl
index aa66f7f..f1daea0 100644
--- a/library/xmfbox.tcl
+++ b/library/xmfbox.tcl
@@ -156,7 +156,7 @@ proc ::tk::MotifFDialog_FileTypes {w} {
# The filetypes radiobuttons
# set data(fileType) $data(-defaulttype)
# Default type to first entry
- set initialTypeName [lindex $data(-filetypes) 0 0]
+ set initialTypeName [lindex $data(origfiletypes) 0 0]
if {$data(-typevariable) ne ""} {
upvar #0 $data(-typevariable) typeVariable
if {[info exists typeVariable]} {
@@ -165,7 +165,7 @@ proc ::tk::MotifFDialog_FileTypes {w} {
}
set ix 0
set data(fileType) 0
- foreach fltr $data(-filetypes) {
+ foreach fltr $data(origfiletypes) {
set fname [lindex $fltr 0]
if {[string first $initialTypeName $fname] == 0} {
set data(fileType) $ix
@@ -185,7 +185,7 @@ proc ::tk::MotifFDialog_FileTypes {w} {
set cnt 0
if {$data(-filetypes) ne {}} {
foreach type $data(-filetypes) {
- set title [lindex [lindex $type 0] 0]
+ set title [lindex $type 0]
set filter [lindex $type 1]
radiobutton $f.b$cnt \
-text $title \
@@ -210,7 +210,6 @@ proc ::tk::MotifFDialog_SetFilter {w type} {
variable ::tk::Priv
set data(filter) [lindex $type 1]
- set Priv(selectFileType) [lindex [lindex $type 0] 0]
MotifFDialog_Update $w
}
@@ -299,6 +298,7 @@ proc ::tk::MotifFDialog_Config {dataName type argList} {
# file dialog, but we check for validity of the value to make sure
# the application code also runs fine with the TK file dialog.
#
+ set data(origfiletypes) $data(-filetypes)
set data(-filetypes) [::tk::FDGetFileTypes $data(-filetypes)]
if {![info exists data(filter)]} {
@@ -870,7 +870,7 @@ proc ::tk::MotifFDialog_ActivateSEnt {w} {
if {[info exists data(-typevariable)] && $data(-typevariable) ne ""
&& [info exists data(-filetypes)] && $data(-filetypes) ne ""} {
upvar #0 $data(-typevariable) typeVariable
- set typeVariable [lindex $data(-filetypes) $data(fileType) 0]
+ set typeVariable [lindex $data(origfiletypes) $data(fileType) 0]
}
if {$data(-multiple) != 0} {
@@ -980,9 +980,3 @@ proc ::tk::ListBoxKeyAccel_Reset {w} {
unset -nocomplain Priv(lbAccel,$w)
}
-proc ::tk_getFileType {} {
- variable ::tk::Priv
-
- return $Priv(selectFileType)
-}
-
diff --git a/tests/filebox.test b/tests/filebox.test
index 41382a2..2f87c3e 100644
--- a/tests/filebox.test
+++ b/tests/filebox.test
@@ -281,11 +281,7 @@ foreach mode $modes {
-initialfile $fileName -initialdir $fileDir \
-typevariable tv]
if {[info exists tv]} {
- if {$mode == 0} {
- set typeName $tv
- } else {
- regexp {^(.*) \(.*\)$} $tv dummy typeName
- }
+ set typeName $tv
} else {
set typeName "-unset-"
}