Version 6 of getOpenFile

Updated 2001-11-29 23:08:31

http://www.purl.org/tcl/home/man/tcl8.4/TkCmd/getOpenFile.htm

Note: Unlike most Tk widgets, this widget's name (getOpenFile) is not the same as its creation command (tk_getOpenFile).


tkfbox [L1 ] is a nifty little portable bundle for extending get{Open,Save}File capabilities.

This grabbed my attention because of my recent TIP regarding sub-classing the file dialogs on UNIX (well, non-Windows platforms). But there isn't enough documentation to tell what the benefits of this file are. -- CLN 2001-10-19


tkfbox was originally from sun, but partially reworked by me (Mick O'Donnell). I was recently asked why I used it rather than the now standard tk_getOpenFile/tk_getSaveFile. Well, I have so far found 4 advantages of pure the tcl/tk code versions:

  • Can set background colors to the window: the buildin

versions are limited to a gray background. the tkfbox version uses the default background color.

  • Doesn't fall prey to the bug in the built in

version which means that double clicks on a file name are not totally consumed, and can cause a click event on a widget below the open file dialog. This can be patched, but it is a problem.

  • When you call the tkfbox tk_getSaveFile with multiple

filetypes specified, and change the filetype using the filetype listitem, then the displayed filename will change its extension. E.g., changing from jpg to gif will also change the filename's extension. This doesnt happen with the built in tk_getSaveFile.

  * The real advantage is that since the tkfbox version is

tcl/tk code, I can adapt it at will. If there is some feature I don't like in the built-in version, I can change/add/delete the feature.


Tk syntax help - Arts and crafts of Tcl-Tk programming - Category Command