summaryrefslogtreecommitdiffstats
path: root/ds9/library
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-01-03 19:34:25 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-01-03 19:34:25 (GMT)
commita6b4d3502588a293d33c44e807af40cea4cb557f (patch)
treeb493c5e945fa6556be710d8abcc36ddecfd9a832 /ds9/library
parent04fcf75810176f679528cf0013a56cf30e08372d (diff)
downloadblt-a6b4d3502588a293d33c44e807af40cea4cb557f.zip
blt-a6b4d3502588a293d33c44e807af40cea4cb557f.tar.gz
blt-a6b4d3502588a293d33c44e807af40cea4cb557f.tar.bz2
upgrade to tcl/tk 8.6.8
Diffstat (limited to 'ds9/library')
-rw-r--r--ds9/library/tkfbox.tcl23
-rw-r--r--ds9/library/xmfbox.tcl21
2 files changed, 24 insertions, 20 deletions
diff --git a/ds9/library/tkfbox.tcl b/ds9/library/tkfbox.tcl
index 66cd74e..50a9d6c 100644
--- a/ds9/library/tkfbox.tcl
+++ b/ds9/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)]} {
@@ -748,17 +749,17 @@ proc ::tk::dialog::file::ResolveFile {context text defaultext {expandEnv 1}} {
set path "$path$defaultext"
}
- # we want to strip any filtering/ext/blocking instructions
- # from the file name
-
- set aa [string first "\[" $path]
- if {$aa > 0} {
+ # we want to strip any filtering/ext/blocking instructions
+ # from the file name
+
+ set aa [string first "\[" $path]
+ if {$aa > 0} {
set fn [string range $path 0 [expr $aa-1]]
- } else {
+ } else {
set fn $path
- }
-
- if {[catch {file exists $fn}]} {
+ }
+
+ if {[catch {file exists $fn}]} {
# This "if" block can be safely removed if the following code stop
# generating errors.
#
@@ -1129,7 +1130,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) <Destroy> {}
diff --git a/ds9/library/xmfbox.tcl b/ds9/library/xmfbox.tcl
index fb821c8..41726ce 100644
--- a/ds9/library/xmfbox.tcl
+++ b/ds9/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]
ttk::radiobutton $f.b$cnt \
-text $title \
@@ -299,6 +299,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)]} {
@@ -739,10 +740,10 @@ proc ::tk::MotifFDialog_BrowseFList {w} {
$data(fEnt) delete 0 end
$data(fEnt) insert 0 [::tk::dialog::file::JoinFile $data(selectPath) \
$data(filter)]
-# $data(fEnt) xview end
-
- # if it's a multiple selection box, just put in the filenames
- # otherwise put in the full path as usual
+ $data(fEnt) xview end
+
+ # if it's a multiple selection box, just put in the filenames
+ # otherwise put in the full path as usual
$data(sEnt) delete 0 end
if {$data(-multiple) != 0} {
$data(sEnt) insert 0 $data(selectFile)
@@ -750,7 +751,7 @@ proc ::tk::MotifFDialog_BrowseFList {w} {
$data(sEnt) insert 0 [::tk::dialog::file::JoinFile $data(selectPath) \
[lindex $data(selectFile) 0]]
}
-# $data(sEnt) xview end
+ $data(sEnt) xview end
}
# ::tk::MotifFDialog_ActivateFList --
@@ -855,7 +856,7 @@ proc ::tk::MotifFDialog_ActivateSEnt {w} {
} else {
set fn $item
}
-
+
if {![file exists $fn]} {
if {$data(type) eq "open"} {
tk_messageBox -icon warning -type ok \
@@ -880,7 +881,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} {