What's the difference between "update" and "update_idletasks"?
The only difference I see is that update processes all pending events and calls event callbacks. That's why we should not call update from within an even callback, I suppose.
You are correct on both accounts.
What are pending events? Events scheduled with after
, mostly. And, as you also mentioned in your question, events that trigger a redraw.
The circumstances when you should use update
over update_idletasks
? Almost never. In all honesty, my pragmatic answer is "never call update
unless calling update_idletasks
doesn't do enough".
The important thing to remember is that update
blocks until all events are processed. In effect, that means you have a mainloop
nested inside a mainloop
. It's never a good idea to have an infinite loop inside an infinite loop.
If you see examples where one is called after the other, you're looking at bad examples. Honestly, there's absolutely no reason whatsoever to do that. A lot of code I see calls update
way more often than it ever should.