Using version 8.5.2, built from sources, with --enable-64-bit. OpenSuse version 10.3
tk_getOpenFile -multiple 1
does not work. After selecting a few files (whose names correctly appear in File names listbox), pressing Open button results in failure message (which appears to arise from lines 1663/1664 of tkfbox.tcl.
No problems with this on Windows, using ActibeState binary.
Ian Gay
gay@sfu.ca
Logged In: NO
Testing old versions shows that this bug first appeared in 8.5b3 (the first ttk version).
Diagnostic printing shows that in
proc ::tk::dialog::file::ActivateEnt
the assignment
set selIcos [::tk::IconList_CurSelection $data(icons)]
always produces an empty list after a multiple selection. I don't yet understand why this is.
Ian Gay
gay@sfu.ca
Logged In: YES
user_id=214862
Originator: NO
The immediate cause of the problem is the command
IconList_Selection $w clear 0 end
in
::tk::IconList_FocusOut (in tkfbox.tcl)
With the ttk widgets, a canvas FocusOut event is generated when you press the Open button (This behaviour is pointed out in http://wiki.tcl.tk/20050
The suggestion there, to insert
bind TButton <ButtonPress-1> {%W state pressed}
at an appropriate place appears to work. (I inserted it at the top of
::tk::dialog::file::)
This may not be a good idea - changing class behaviour globally seems yucky. Adding -takefocus 0 to the button definition in
::tk::dialog::file::Create
also works, and seems better to me.
This dialog needs to be reviewed by someone who knows the details of tk and tk better than I do. There are a few other problems ... e.g. the Alt_O binding doesn't work.
Ian
Logged In: YES
user_id=214862
Originator: NO
While looking at the source code, in connection with the above bug, I found a wonderful feature! There is code in place to allow exclusion/inclusion of unix hidden files in the search. Unfortunately, there is no mechanism for script authors to access this code. I think it would be a great idea to activate this code by provision of a suitable argument to the tk_get... procedures.
Logged In: YES
user_id=72656
Originator: NO
Ah yes, I snuck that switch in because I felt it was necessary, but not part of the standard API fit. A small TIP could address that I guess, but [-hidden bool] really only means something on unix-based systems.
Logged In: YES
user_id=79902
Originator: NO
It's meaningful on both Win and OSX. Win supports forcing the showing of hidden files on 2K/XP (and probably Vista too; the page I was reading predates that) via the OFN_FORCESHOWHIDDEN flag. At least one of the OSX APIs for file selection supports filtering, but the docs are complex enough that I can't tell for sure if that is something we can take advantage of.
Logged In: YES
user_id=72656
Originator: NO
Passing to Donal - regression added in tile updates.
Logged In: YES
user_id=92123
Originator: NO
Confirmed that this bug exists in 8.5.4 and 8.6 (CVS HEAD).
Logged In: YES
user_id=1388916
Originator: NO
See also #2046267 and http://wiki.tcl.tk/20050.
Logged In: YES
user_id=92123
Originator: NO
This has been fixed and applied to the 8.6 CVS head.
Logged In: NO
So should #1904322 be closed as well since it has been said there it's a duplicate?