gtk TextView widget doesn't update during function
问题 I'm new to GUI programming with python and gtk, so this is a bit of a beginners question. I have a function that is called when a button is pressed which does various tasks, and a TextView widget which I write to after each task is completed. The problem is that the TextView widget doesn't update until the entire function has finished. I need it to update after each task. 回答1: After each update to the TextView call while gtk.events_pending(): gtk.main_iteration() You can do your update