我有一个 python 脚本,使用 FileChooserDialog 向用户请求文件。完成后,它会在对话框上调用 .destroy(),但此后立即开始加载文件。由于它通常是一个大文件,因此对话框“保留在屏幕上”,直到解析完成、创建主窗口并运行 MainLoop。是否可以“刷新 X”或某物,或者我真的必须创建一些“加载窗口”吗?
最佳答案
尝试强制GTK刷新屏幕
while gtk.events_pending(): # this forces the refresh of the screen
gtk.main_iteration()
打开文件之前
关于python - destroy() 后 FileChooserDialog 卡在屏幕上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7417469/