The problem is with the fundamental design of Tk. In the short version, bindings to specific widgets light up before the default class bindings for the widget. In class bindings, the list selection changes. This is exactly what you are observing - you see the selection before the current click.
The best solution is to bind to the virtual event <<ListboxSelect>> , which is fired after changing the selection. Other solutions (unique to Tk and what gives it incredible power and flexibility) are to change the binding order. This includes either moving the bindtag widget after the bindtag class, or adding a new bindtag after binding the class and binding it to it.
Since binding to <<ListboxSelect>> is the best solution, I will not go into details on how to change the binding, although this is straightforward, and I think it is well documented.
source share