diff options
author | stanton <stanton> | 1998-06-24 16:05:34 (GMT) |
---|---|---|
committer | stanton <stanton> | 1998-06-24 16:05:34 (GMT) |
commit | 4a4091d8d3e7e8b3559d9b3b69f72b5c2020d520 (patch) | |
tree | be9d73c70010730081c8b5966f6b5f6f4cf5a4f6 /library/tkfbox.tcl | |
parent | 13d3d8619de3fd760447e51e420766fb5d52f5f0 (diff) | |
download | tk-4a4091d8d3e7e8b3559d9b3b69f72b5c2020d520.zip tk-4a4091d8d3e7e8b3559d9b3b69f72b5c2020d520.tar.gz tk-4a4091d8d3e7e8b3559d9b3b69f72b5c2020d520.tar.bz2 |
fixed initialdir bug
Diffstat (limited to 'library/tkfbox.tcl')
-rw-r--r-- | library/tkfbox.tcl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl index 31ca6f8..dc0c267 100644 --- a/library/tkfbox.tcl +++ b/library/tkfbox.tcl @@ -632,7 +632,6 @@ proc tkFDialog {args} { global tkPriv set w __tk_filedialog upvar #0 $w data - if ![string compare [lindex [info level 0] 0] tk_getOpenFile] { set type open } else { @@ -771,11 +770,19 @@ proc tkFDialog_Config {w type argList} { # settings # if [string compare $data(-initialdir) ""] { + if [file isdirectory $data(-initialdir)] { set data(selectPath) [glob $data(-initialdir)] } else { - error "\"$data(-initialdir)\" is not a valid directory" + set data(selectPath) [pwd] } + + # Convert the initialdir to an absolute path name. + + set old [pwd] + cd $data(selectPath) + set data(selectPath) [pwd] + cd $old } set data(selectFile) $data(-initialfile) |