• Why <> is trigger on item delete from 8.6.10 ?

    From lamuzzachiodi@gmail.com@21:1/5 to All on Wed Nov 17 15:44:15 2021
    It seems to me that the old behavior was more coherent.
    If i delete all the tree, for example, i don't choose an item, which is the new selection?.
    On other hand, if this is related to some kind of change in the structure of the tree, why is not triggered when it is added an item?.
    So, i'm curious about the reason of this change.
    Thanks,

    Alejandro

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Francois Vogel@21:1/5 to All on Thu Nov 18 05:49:03 2021
    Le 18/11/2021 à 00:44, lamuzz...@gmail.com a écrit :
    So, i'm curious about the reason of this change.

    That was a bugfix. The man page says:

    <<TreeviewSelect>>
    Generated whenever the selection changes.

    But this didn't happen when deleting selected items. In such a case, the selection indeed changes but the event did not fire up to 8.6.9.

    See details here:

    https://core.tcl-lang.org/tk/tktview?name=2a6c62afd9

    The fix went in 8.6.10.

    Regards,
    Francois

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From lamuzzachiodi@gmail.com@21:1/5 to All on Fri Nov 19 17:20:27 2021
    Francois,
    thanks for your anwser.
    Testing a modified version of your example, you can see how the "selection" command always trigger the event.
    Should not it be true only for the subcomand "toggle", but not for the rest if the selection does not change?.
    For example, "Clear Selection" continues triggering the event, even when there is nothing selected, that is, there is no change. The same for "remove" and "add".
    Saludos,
    Alejandro



    ttk::treeview .t

    pack .t

    for {set i 1} {$i < 6} {incr i} {
    .t insert {} end -text "Item # $i"
    }

    bind .t <<TreeviewSelect>> show

    proc show {} {
    puts "TreeviewSelect fired"
    puts "Current selection is '[ .t selection ]'"
    }

    button .b1 -text "Clear Selection" -command {.t selection set ""}
    button .b2 -text "Delete Selected" -command {.t delete [.t selection]}
    button .b3 -text "Remove Selection" -command {.t selection remove [.t selection]}
    button .b4 -text "Add item" -command {.t insert {} end -text "Item # [incr i]"}
    button .b5 -text "Set Focus 1" -command {.t focus I001}
    button .b6 -text "Get Focus" -command {puts [.t focus]}
    button .b7 -text "Select add 4 and 5" -command { .t selection add {I004 I005}}
    button .b8 -text "Select toggle 4" -command { .t selection toggle I004 }
    button .b9 -text "Select 2" -command { .t selection set I002 }

    pack .b1 .b2 .b3 .b4 .b5 .b6 .b7 .b8 .b9 -side top

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Francois Vogel@21:1/5 to lamuzzachiodi@gmail.com on Sat Nov 20 16:18:42 2021
    Le 20/11/2021 à 02:20, lamuzz...@gmail.com a écrit :
    Testing a modified version of your example, you can see how the "selection" command always trigger the event.
    Should not it be true only for the subcomand "toggle", but not for the rest if the selection does not change?.
    For example, "Clear Selection" continues triggering the event, even when there is nothing selected, that is, there is no change. The same for "remove" and "add".

    Yeah, that's true. The ticket concentrated on fixing the reported event,
    I was not aware of remaining issues.

    I have reopened the ticket and will fix this. As far a I have found out,
    the remaining issues are exactly the following ones:

    1. .t selection set "" triggers <<TreeviewSelect>> even if there
    was no selection

    2. .t selection remove "" triggers <<TreeviewSelect>> even if there
    was no selection

    3. selecting already selected elements triggers <<TreeviewSelect>>

    4. .t selection toggle "" triggers <<TreeviewSelect>>

    If I'm still missing any issue, please report here or directly in the
    ticket.

    Thanks!
    Francois

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Francois Vogel@21:1/5 to lamuzzachiodi@gmail.com on Sun Nov 21 20:44:23 2021
    Le 20/11/2021 à 16:18, Francois Vogel a écrit :
    Le 20/11/2021 à 02:20, lamuzz...@gmail.com a écrit :
    Testing a modified version of your example, you can see how the
    "selection" command always trigger the event.

    All issues I know of regarding <<TreeviewSelect>> are now fixed.

    I have added new tests (treeview-8.8 to -8.11) failing before the fix
    and passing after the fix.

    See branch bug-2a6c62afd9:

    https://core.tcl-lang.org/tk/vdiff?branch=bug-2a6c62afd9

    Please test. If I'm still missing a case or something, just tell it here
    or in the ticket.

    Regards,
    Francois

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From lamuzzachiodi@gmail.com@21:1/5 to All on Mon Nov 22 05:41:31 2021
    Thanks, If I find another issue, I will let you know.
    Saludos,

    Alejandro

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Francois Vogel@21:1/5 to lamuzzachiodi@gmail.com on Mon Nov 22 21:32:09 2021
    Le 22/11/2021 à 14:41, lamuzz...@gmail.com a écrit :

    Thanks, If I find another issue, I will let you know.

    Good to know, thanks.

    Did you actually try the fix in the bugfix branch I gave you the link?

    I'd prefer people test fixes before they escape in an official release.
    Less surprises later, you know.

    So please test the fix, if you didn't already.

    Thanks,
    Francois

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From lamuzzachiodi@gmail.com@21:1/5 to All on Tue Nov 23 19:51:15 2021
    Francois, i get the point, but my compiling skills and tools are a bit rusty.
    I don't think I can test it before its release.
    Sorry.

    Saludos,
    Alejandro

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Francois Vogel@21:1/5 to lamuzzachiodi@gmail.com on Wed Nov 24 08:22:09 2021
    Le 24/11/2021 à 04:51, lamuzz...@gmail.com a écrit :

    Francois, i get the point, but my compiling skills and tools are a bit rusty.

    What platform are you using? Building Tcl/Tk is rather easy. You can
    find instructions on the wiki.

    Regards,
    Francois

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)