#1366 -initialfile doesn't hilight filenames

open-remind
7
2009-08-01
2002-12-22
No

tk_getOpenFile -multiple 1 -initialfile [glob *.jpg]

Lists all of the files in the 'filename' entry,
however, they are not selected. It would be nice to
have the visual confirmation that the files are indeed
the ones you want, and also "not breaking the metaphor"
or some such.

Discussion

1 2 > >> (Page 1 of 2)
  • David N. Welton

    David N. Welton - 2002-12-27

    Logged In: YES
    user_id=240

    I am attaching a patch that does two things:

    1) It makes it so that one doesn't lose the selection if the
    mouse goes out of the window. This reflects what I see in
    both listboxes, as well as other toolkits on Linux.

    2) If you have an initialfile, that entry, or entries, are
    selected.

    Thanks!

     
  • David N. Welton

    David N. Welton - 2002-12-27

    Logged In: YES
    user_id=240

    There appears to be another problem. -initialfile selects
    multiple files even if -multiple 1 isn't there.

     
  • David N. Welton

    David N. Welton - 2003-05-12
    • priority: 5 --> 7
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2003-05-13

    Logged In: YES
    user_id=72656

    This patch fails the test suite when placed in the head. Needs
    to be accompanied by new tests.

     
  • David N. Welton

    David N. Welton - 2003-05-14

    Logged In: YES
    user_id=240

    Only running test files that match: filebox.test
    Tests began at Wed May 14 01:57:59 PM CEST 2003
    filebox.test

    Tests ended at Wed May 14 01:58:12 PM CEST 2003
    all.tcl: Total 82 Passed 82 Skipped 0
    Failed 0
    Sourced 2 Test Files.

    So.... what is failing where? This is with a recent (today)
    Tcl and Tk. I will try and add some new tests after I
    figure out how things work.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2003-05-14

    Logged In: YES
    user_id=72656

    There are multiple files with dialog tests, and one of them
    choked on "data(selectFile)" not existing yet. This was on
    the core-8-4-branch.

     
  • David N. Welton

    David N. Welton - 2003-05-15
     
  • David N. Welton

    David N. Welton - 2003-05-15

    Logged In: YES
    user_id=240

    I went back and added some changes that should make things
    behave the same with tk_strictMotif on.

     
  • David N. Welton

    David N. Welton - 2003-05-15
     
  • David N. Welton

    David N. Welton - 2003-05-15

    Logged In: YES
    user_id=240

    Here are a few tests to check and see if things are working
    properly. filebox.test now works without problems. If
    there are other errors, would you be so kind as to point
    them out? I get quite a few that seem completely unrelated
    to this when attempting to run the whole Tk test suite.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2003-05-15

    Logged In: YES
    user_id=72656

    It is the choosedir.test files that are failing, as it appears
    these commands are used there (the Update). Please make
    sure to run the full test suite for patches. Here is the failure
    that choosedir.test throws:

    can't read "data(selectFile)": no such element in array
    while executing
    "lsearch $data(selectFile) [::tk::IconList_Get $data(icons) $i]"
    (procedure "::tk::dialog::file::Update" line 96)
    invoked from within
    "::tk::dialog::file::Update .__tk_choosedir"
    ("after" script)

     
  • David N. Welton

    David N. Welton - 2003-05-15

    Logged In: YES
    user_id=240

    if { [info exists data(selectFile)] } {
    for {set i 0} {$i < [::tk::IconList_Index $data(icons) end]}
    {incr i} {
    if { [lsearch $data(selectFile) [::tk::IconList_Get
    $data(icons) $i]] != -1 } {
    ::tk::IconList_Selection $data(icons) set $i
    }
    }
    }

    Fixes the problem. I just wrap the code in an if. If you
    want I can update the patch, but it's very simple.

    I did attempt to run the whole test suite initially, but I
    get a number of failures in things like the font code...

     
  • Donal K. Fellows

    • assigned_to: hobbs --> dkf
    • priority: 7 --> 8
     
  • Donal K. Fellows

    • priority: 8 --> 5
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    -initialfile is defined as taking a single file as its
    argument. It has to be that way because there may be
    filenames with spaces in floating about (they are
    disappointingly common on non-Unix systems, and we
    absolutely want to keep the same API.) Alterations to this
    will require a TIP, and hence can't be done for 8.4 at all.

     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    See TIP#141

     
  • Donal K. Fellows

    • priority: 5 --> 9
     
  • Donal K. Fellows

    • assigned_to: dkf --> hobbs
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    Assigning to someone who has a working testbed... :^/

    Still required (IMHO):
    Update so that multiple files work on Windows
    Update so that multiple files work on Macs
    Update to documentation
    More careful review of tests

    (Also deleted old patch, confusingly named "latest.diff")

     
  • David N. Welton

    David N. Welton - 2004-03-12

    Logged In: YES
    user_id=240

    Here is a documentation patch.

     
  • David N. Welton

    David N. Welton - 2004-03-12
     
  • David N. Welton

    David N. Welton - 2004-03-12

    Logged In: YES
    user_id=240

    I have added another patch which corrects something that kbk
    pointed out. Arguments to -initialfile should all be in
    the directory displayed.

     
  • Jim Ingham

    Jim Ingham - 2004-03-13

    Implements multiple initialfile selection on Mac OS X

     
  • David N. Welton

    David N. Welton - 2004-03-31

    Logged In: YES
    user_id=240

    Adding a test for malformed -initialfile lists combined with
    -multiple.

     
  • David N. Welton

    David N. Welton - 2004-03-31
     
1 2 > >> (Page 1 of 2)