This is really a pain, as often these dialogs start at the home directory which is full of hidden files and directories in Linux.
There is a workaround for this unlucky default setup of file dialogs. Please see [(http://wiki.tcl.tk/1060)] when the discussion reaches June 2011: 'Is there a way to disable displaying of hidden directories in Linux (starting with a dot ".") when file sector dialog opens?'.
So I would like to put the following workaround for tkd into discussion. (I am new in D-programming, so there might well be a smarter approach.)
Background: As this workaround allocates resources (a dummy call to tk_getOpenFile is needed), it should be executed only once and only if the application uses DirectoryDialog, OpenFileDialog or SaveFileDialog.
Add following member to Dialog:
/**
* Workaround to fix default of file dialogs showing unwanted
* hidden files and directories on Posix systems.
*
* To be called from constructor of FileDialog and of DirectoryDialog
* when on version(Posix).
*/
protected final void fixFileOrDirDialog() {
static bool fixed;
if (!fixed) {
fixed = true;
this._tk.eval("catch {tk_getOpenFile foo bar}"); // Dummy that instanciates below variables.
this._tk.eval("set ::tk::dialog::file::showHiddenVar 0"); // Don't show hidden entities.
this._tk.eval("set ::tk::dialog::file::showHiddenBtn 1"); // Show switch for hiddent entities.
}
}
Modify the constructor of FileDialog (line 57ff) as follows:
This is really a pain, as often these dialogs start at the home directory which is full of hidden files and directories in Linux.
There is a workaround for this unlucky default setup of file dialogs. Please see [(http://wiki.tcl.tk/1060)] when the discussion reaches June 2011: 'Is there a way to disable displaying of hidden directories in Linux (starting with a dot ".") when file sector dialog opens?'.
So I would like to put the following workaround for tkd into discussion. (I am new in D-programming, so there might well be a smarter approach.)
Background: As this workaround allocates resources (a dummy call to tk_getOpenFile is needed), it should be executed only once and only if the application uses DirectoryDialog, OpenFileDialog or SaveFileDialog.
Dialog
:FileDialog
(line 57ff) as follows:DirectoryDialog
(54ff) as follows:Sorry, but I could not find a solution where to touch only one spot in the code while holding the background condition mentioned above.
Regards, Karl