Python/Tkinter: Turn on/off screen updates like wx

2019-01-29 05:52发布

Does Tkinter provide a way to temporarily turn off screen updates (when performing a large amount of screen activity) and then turn on screen updates when the UI updates are complete? Many GUI frameworks have this feature. wxPython provides Freeze and Thaw methods for this functionality. The Windows Win32api supports this as well via LockWindowUpdate( hWnd | 0 ). Googling on "tkinter freeze thaw" and "tkinter lockwindowupdate" came up emtpy.

1条回答
兄弟一词,经得起流年.
2楼-- · 2019-01-29 06:13

No, Tkinter has no such thing. However, the screen is only updated via the event loop, so if all of your "large amount of screen activity" is happening in a single method, none of the activity will show up until your method finishes and the event loop is re-entered (or you explicitly call .update_idletasks())

查看更多
登录 后发表回答