2006-02-14 [HE] - The native file selection dialog box shows only files from /My Documents and files of the first level of directories inside /My Documents. For me this is not very useful. I remembered their are a build in file selection dialog box for Unix platforms. It resides in the file lib/tk/tkfbox.tcl. Some tests shows that this dialogbox can used on pockentPC with etcl. Only some changes are needed. A simple package can help to use the following dialog boxes: tk_getOpenFile, tk_getSaveFile, tk_chooseDir I name it he-dialog. he- is only used to separate my packages/code from others. Using only dialog contains the risk to interfer with other packages. It sources the original files and changes it online. Then it exchange the native commands with the patched one. How to build the package: 1. Create a directory to collect all the parts of the package. For example dialogDir 2. Get the following files from the cvstree on http://tcl.sourceforge.net/ and copy them into this directory. By now the script needs exactly this versions. With other versions it could fail.: * tk/library/choosedir.tcl Version 1.19 * tk/library/tkfbox.tcl Version 1.55 3. Create a file he-dialog # he-dialog.tcl # Version 0.0 proc windowFit {top} { # This proc is used in other scripts, too. if {$::tcl_platform(os) eq {Windows CE}} { if {[info exists ::etcl::etcl]} { bind $top {::etcl::autofit %W} ::etcl::autofit $top } else { wm geometry $top 240x[expr 320 - 51]+0+0 } } else { wm geometry $top 240x[expr 320 - 51]+[expr [winfo pointerx .] - 120]+[expr [winfo pointery .] - 135] } return } if {[info exists ::etcl::etcl]} { # # tk_getOpenFile, tk_getSaveFile # # online patching of file tkfbox.tcl,v 1.55 set body [split [info body ::tk::dialog::file::] "\n"] set changeA [list "\t# HE: Change the requester size to fit on pda" "\twindowFit \$w" {}] set changeB [list "\t# HE: To make the dialog window transient creates a title bar?!" "\t# (at least in etcl-8.4.12-pl7 and etcl-8.4.12-pl8)" "#[lindex $body 52]" "#[lindex $body 53]" "#[lindex $body 54]"] set body1 [join [concat [lrange $body 0 51] $changeB [lrange $body 55 end-20] $changeA [lrange $body end-19 end]] "\n"] proc ::tk::dialog::file:: {type args} $body1 # and exchange the procs rename ::tk_getOpenFile ::_tk_getOpenFile ;# The way back proc ::tk_getOpenFile {args} { return [eval ::tk::dialog::file:: open $args] } rename ::tk_getSaveFile ::_tk_getSaveFile ;# The way back proc ::tk_getSaveFile {args} { return [eval ::tk::dialog::file:: save $args] } # # tk_chooseDirectory # # online patching of file choosedir.tcl,v 1.19 set body [split [info body ::tk::dialog::file::chooseDir::] "\n"] set changeA [list "\t# HE: Change the requester size to fit on pda" "\twindowFit \$w" {}] set changeB [list "\t# HE: To make the dialog window transient creates a title bar?!" "\t# (at least in etcl-8.4.12-pl7 and etcl-8.4.12-pl8)" "#[lindex $body 44]" "#[lindex $body 45]" "#[lindex $body 46]"] set body1 [join [concat [lrange $body 0 43] $changeB [lrange $body 47 end-23] $changeA [lrange $body end-22 end]] "\n"] proc ::tk::dialog::file::chooseDir:: {type args} $body1 # and exchange the procs rename ::tk_chooseDirectory ::_tk_chooseDirectory proc ::tk_chooseDirectory {args} { return [eval ::tk::dialog::file::chooseDir:: $args] } } package provide he-dialog 0.0 4. We need a file pkgIndex.tcl with the following contens: package ifneeded he-dialog 0.0 " [list source [file join $dir tkfbox.tcl] ;] [list source [file join $dir choosedir.tcl] ;] [list source [file join $dir he-dialog.tcl] ] " 5. Move the directory dialogDir to a directory in the auto_path of etcl. This is file join [file dirname etcl.exe] .. lib That's it! Hope I hasn't copy any error inside the code :-) Load the package with package require he-dialog and now you can use the old new dialogboxes tk_getOpenFile, tk_getSaveFile and tk_chooseDir. You can load the package inside the console: console eval {package require he-dialog} ---- [RS]: Very good work! Following your instructions, making and installing it went all flawlessly. Now I'm back to the old-fashioned Unix fileselectors, but still more empowered than Microsoft would have us... Thanks you! ---- [Category GUI] | [Category Mobile]