summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2001-09-17 14:12:18 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2001-09-17 14:12:18 (GMT)
commitd389b7c614bed2adeef2c44844cb67d6bc563b21 (patch)
treebb02743e7271506bcb98a0712fc25eb2d2b11cc5 /library
parentd8142ec988da069be185faa5b25c0cf258a7e452 (diff)
downloadtk-d389b7c614bed2adeef2c44844cb67d6bc563b21.zip
tk-d389b7c614bed2adeef2c44844cb67d6bc563b21.tar.gz
tk-d389b7c614bed2adeef2c44844cb67d6bc563b21.tar.bz2
Fixed string/list confusion in directory browser, and a typo in ChangeLog
Diffstat (limited to 'library')
-rw-r--r--library/choosedir.tcl7
-rw-r--r--library/tkfbox.tcl25
2 files changed, 17 insertions, 15 deletions
diff --git a/library/choosedir.tcl b/library/choosedir.tcl
index ee4dfb1..8f1df99 100644
--- a/library/choosedir.tcl
+++ b/library/choosedir.tcl
@@ -5,7 +5,7 @@
# Copyright (c) 1998-2000 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: choosedir.tcl,v 1.10 2001/08/01 16:21:11 dgp Exp $
+# RCS: @(#) $Id: choosedir.tcl,v 1.11 2001/09/17 14:12:18 dkf Exp $
# Make sure the tk::dialog namespace, in which all dialogs should live, exists
namespace eval ::tk::dialog {}
@@ -222,10 +222,11 @@ proc ::tk::dialog::file::chooseDir::DblClick {w} {
upvar ::tk::dialog::file::[winfo name $w] data
set selection [tk::IconList_Curselection $data(icons)]
if { [llength $selection] != 0 } {
- set text [tk::IconList_Get $data(icons) [lindex $selection 0]]
+ set filenameFragment \
+ [tk::IconList_Get $data(icons) [lindex $selection 0]]
set file $data(selectPath)
if {[file isdirectory $file]} {
- ::tk::dialog::file::ListInvoke $w $text
+ ::tk::dialog::file::ListInvoke $w [list $filenameFragment]
return
}
}
diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl
index be10d49..7fce44e 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.30 2001/09/12 19:13:56 drh Exp $
+# RCS: @(#) $Id: tkfbox.tcl,v 1.31 2001/09/17 14:12:18 dkf Exp $
#
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
#
@@ -1626,17 +1626,17 @@ proc ::tk::dialog::file::JoinFile {path file} {
proc ::tk::dialog::file::OkCmd {w} {
upvar ::tk::dialog::file::[winfo name $w] data
- set text {}
+ set filenames {}
foreach item [::tk::IconList_Curselection $data(icons)] {
- lappend text [::tk::IconList_Get $data(icons) $item]
+ lappend filenames [::tk::IconList_Get $data(icons) $item]
}
- if {([llength $text] && !$data(-multiple)) || \
- ($data(-multiple) && ([llength $text] == 1))} {
- set text [lindex $text 0]
- set file [::tk::dialog::file::JoinFile $data(selectPath) $text]
+ if {([llength $filenames] && !$data(-multiple)) || \
+ ($data(-multiple) && ([llength $filenames] == 1))} {
+ set filename [lindex $filenames 0]
+ set file [::tk::dialog::file::JoinFile $data(selectPath) $filename]
if {[file isdirectory $file]} {
- ::tk::dialog::file::ListInvoke $w [list $text]
+ ::tk::dialog::file::ListInvoke $w [list $filename]
return
}
}
@@ -1702,14 +1702,15 @@ proc ::tk::dialog::file::ListBrowse {w} {
# Gets called when user invokes the IconList widget (double-click,
# Return key, etc)
#
-proc ::tk::dialog::file::ListInvoke {w text} {
+proc ::tk::dialog::file::ListInvoke {w filenames} {
upvar ::tk::dialog::file::[winfo name $w] data
- if {[llength $text] == 0} {
+ if {[llength $filenames] == 0} {
return
}
- set file [::tk::dialog::file::JoinFile $data(selectPath) [lindex $text 0]]
+ set file [::tk::dialog::file::JoinFile $data(selectPath) \
+ [lindex $filenames 0]]
set class [winfo class $w]
if {[string equal $class TkChooseDir] || [file isdirectory $file]} {
@@ -1724,7 +1725,7 @@ proc ::tk::dialog::file::ListInvoke {w text} {
}
} else {
if {$data(-multiple)} {
- set data(selectFile) $text
+ set data(selectFile) $filenames
} else {
set data(selectFile) $file
}