Current set of file dialogs in Tk provides only dialogs
for open of existing file and save to file with
confirmation of overwriting file.
This is enough to implement standard File menu in the
CUA compatible application, where New command and Open
command are distinct.
But uses of file dialogs are not limiting to opening
main document to work with. There are some auxiliary
files which names can be configured in configuration
dialog for example, and existense/non-existense of
these files can be handled programmaticaly more clever
way. At least user should be asked "File doesn't exist,
create one with default values" rather than "File
exist, it's ok to overwrite" if we deal with
configuration file.
In some cases (such as log files) file could be
silently created when it doesn't exist, and appended if
it exist.
Current tk_get*File model doesn't provide way to handle
such situation.
This patch adds option -allownonexistent to
tk_getOpenFile, which allows it to return valid
non-existent filename just as tk_getSaveFile does and
let application to handle existense of file.
Patch to the getOpenFile manpage is also included.
This patch provides implementation only for Unix and
Windows, since I don't have any Mac handy to debug it.
Patch to tk_getOpenFile -allownonexistent
Logged In: YES
user_id=79902
Requires TIP...
Logged In: YES
user_id=757679
Resently I've discovered that provided patch supports only
Windows NT family, not Windows 9x. I've modified GetFileW
function, but forget to fix GetFileA. Simular changes should
be done to it.