Tkinter ttk Treeview binding responds to past events!

MRAB python at mrabarnett.plus.com
Tue Sep 12 15:55:33 EDT 2023


On 2023-09-12 19:51, Mirko via Python-list wrote:
> Am 12.09.23 um 07:43 schrieb John O'Hagan via Python-list:
> 
>> My issue is solved, but I'm still curious about what is happening here.
> 
> MRAB already said it: When you enter the callback function, Tk's
> mainloop waits for it to return. So what's happening is:
> 
> 1. Tk's mainloop pauses
> 2. temp_unbind() is called
> 3. TreeviewSelect is unbound
> 4. events are queued
> 5. TreeviewSelect is bound again
> 6. temp_unbind() returns
> 7. Tk's mainloop continues with the state:
> 	- TreeviewSelect is bound
> 	- events are queued
> 
> Am 11.09.23 um 23:58 schrieb Rob Cliffe:
> 
>> Indeed.  And you don't need to specify a delay of 100 milliseconds. 0 will work (I'm guessing that's because queued actions are performed in the order that they were queued).
> 
> Ah, nice, didn't know that!
> 
Well, strictly speaking, it's the order in which they were queued except 
for .after, which will be postponed if you specify a positive delay.

[snip]



More information about the Python-list mailing list