summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2001-09-17 14:12:17 (GMT)
committerdkf <dkf@noemail.net>2001-09-17 14:12:17 (GMT)
commita74f11ae80e2f68639b4ba0a70cfcb03598c6191 (patch)
treebb02743e7271506bcb98a0712fc25eb2d2b11cc5 /library
parent2117a9e0a851883c3f7cb5d800bf64ae66b6622f (diff)
downloadtk-a74f11ae80e2f68639b4ba0a70cfcb03598c6191.zip
tk-a74f11ae80e2f68639b4ba0a70cfcb03598c6191.tar.gz
tk-a74f11ae80e2f68639b4ba0a70cfcb03598c6191.tar.bz2
Fixed string/list confusion in directory browser, and a typo in ChangeLog
FossilOrigin-Name: 7aebeca26c59f627b8cb1ee84085fa26e60ff272
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
}