Menu

#2435 tk_getOpenFile -multiple 1 fails on Linux

obsolete: 8.6a2
closed-fixed
8
2008-08-25
2008-04-06
Anonymous
No

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

Discussion

  • Nobody/Anonymous

    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

     
  • Ian Gay

    Ian Gay - 2008-04-09

    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

     
  • Donal K. Fellows

    • labels: --> 37. [tk_get*File]
    • assigned_to: nobody --> hobbs
    • priority: 5 --> 7
    • milestone: --> 824501
     
  • Ian Gay

    Ian Gay - 2008-04-30

    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.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2008-05-01

    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.

     
  • Donal K. Fellows

    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.

     
  • Pat Thoyts

    Pat Thoyts - 2008-06-24
    • priority: 7 --> 8
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2008-08-19
    • assigned_to: hobbs --> dkf
    • milestone: 824501 --> 869893
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2008-08-19

    Logged In: YES
    user_id=72656
    Originator: NO

    Passing to Donal - regression added in tile updates.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2008-08-19
    • assigned_to: dkf --> tmh
     
  • Todd Helfter

    Todd Helfter - 2008-08-19

    Logged In: YES
    user_id=92123
    Originator: NO

    Confirmed that this bug exists in 8.5.4 and 8.6 (CVS HEAD).

     
  • Todd Helfter

    Todd Helfter - 2008-08-19
    • status: open --> open-accepted
     
  • Koen Danckaert

    Koen Danckaert - 2008-08-19

    Logged In: YES
    user_id=1388916
    Originator: NO

    See also #2046267 and http://wiki.tcl.tk/20050.

     
  • Todd Helfter

    Todd Helfter - 2008-08-25
    • milestone: 869893 --> obsolete: 8.6a2
    • status: open-accepted --> closed-fixed
     
  • Todd Helfter

    Todd Helfter - 2008-08-25

    Logged In: YES
    user_id=92123
    Originator: NO

    This has been fixed and applied to the 8.6 CVS head.

     
  • Nobody/Anonymous

    Logged In: NO

    So should #1904322 be closed as well since it has been said there it's a duplicate?