Tk Source Code

View Ticket
Login
Ticket UUID: 1611821
Title: tk_getSaveFile -initialfile odd behavior
Type: Bug Version: obsolete: 8.4.14
Submitter: hobbs Created on: 2006-12-08 20:35:33
Subsystem: 37. [tk_get*File] Assigned To: das
Priority: 6 Severity:
Status: Open Last Modified: 2006-12-14 22:03:28
Resolution: Accepted Closed By:
    Closed on:
Description:
If you do:

set someRealFile /Library/Tcl/Tclapplescript/pkgIndex.tcl
tk_getSaveFile -initialfile $someRealFile

the dialog converts the / to -.  The workaround is to separate file and dir segments for -initialdir and -initialfile, but that is not the way Tk docs it, so it really is a Tk/Aqua bug.
User Comments: dkf added on 2006-12-14 22:03:28:
Logged In: YES 
user_id=79902
Originator: NO

If both are present, [file join] them and then [file split] them to get the real directory to start in and the real "initally selected filename".

das added on 2006-12-14 06:52:01:
Logged In: YES 
user_id=90580
Originator: NO

the reason for this is that NavServices does not expect the -initialfile param to be a path but a filename in the -initialdir, and hence it munges any chars in the -initialfile that are illegal for filenames.
What behaviour did you expect to see in this case exactly? the docs are not clear what to do with a path for -initialfile IMO, indeed getOpenFile.n says -initialfile is a "filename" (and that -initialfile is not implemented on the Mac, along with other obsolete Mac info; doc bug).
We could extract any initial path component from the -initialfile param and handle it as if -initialdir had also been given, but what to do when both -initialdir and -initialfile with a path are present?