Tcl/Tk version 8.6.1

I just noticed while experimenting with the ttk::treeview that the treeview widget does not fire a <<TreeviewSelect>> event when an item that is presently selected is deleted.

Is this an intended outcome?  The manpage says:

       <<TreeviewSelect>>
           Generated whenever the selection changes.

It would seem that deleting an item that is selected is also a change to the selection, which should have fired a TreeviewSelect event.

Demo code:


  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]}

  pack .b1 .b2 -side top

Run the demo from a terminal so you can see the output of the puts.  Select one or more items with the mouse, notice the event fires.  While one or more items are selected, clear the selection using the "Clear Selection" button.  Notice that the event fires.

Now select one or more items and push the "delete selected" button.  Notice the items are deleted (and the selection disappears, because the selected items no longer exist) but no event fires.