diff options
author | hobbs <hobbs> | 2003-11-12 00:07:03 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2003-11-12 00:07:03 (GMT) |
commit | 8e6072517cd44c3d54f6c561fe69adf4ce1f3244 (patch) | |
tree | 0491b4e2adcf7fb0504d4c4ca01b636824db0101 /library | |
parent | 035dab0d6ab9d25ed8dfd35f86765d50e973b419 (diff) | |
download | tk-8e6072517cd44c3d54f6c561fe69adf4ce1f3244.zip tk-8e6072517cd44c3d54f6c561fe69adf4ce1f3244.tar.gz tk-8e6072517cd44c3d54f6c561fe69adf4ce1f3244.tar.bz2 |
(::tk::dialog::file::ActivateEnt): allow typing filename into
entry when tk_getOpenFile -multiple 1 is specified. [Bug #788069]
Diffstat (limited to 'library')
-rw-r--r-- | library/tkfbox.tcl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl index 4d46903..2173a0d 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.40 2003/11/11 22:48:14 hobbs Exp $ +# RCS: @(#) $Id: tkfbox.tcl,v 1.41 2003/11/12 00:07:03 hobbs Exp $ # # Copyright (c) 1994-1998 Sun Microsystems, Inc. # @@ -1509,10 +1509,17 @@ proc ::tk::dialog::file::ActivateEnt {w} { # names as a true list, watching out for a single file with a # space in the name. Thus we query the IconList directly. + set selIcos [::tk::IconList_Curselection $data(icons)] set data(selectFile) "" - foreach item [::tk::IconList_Curselection $data(icons)] { - ::tk::dialog::file::VerifyFileName $w \ + if {[llength $selIcos] == 0 && $text ne ""} { + # This assumes the user typed something in without selecting + # files - so assume they only type in a single filename. + ::tk::dialog::file::VerifyFileName $w $text + } else { + foreach item $selIcos { + ::tk::dialog::file::VerifyFileName $w \ [::tk::IconList_Get $data(icons) $item] + } } } else { ::tk::dialog::file::VerifyFileName $w $text |