Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
调用 gtk.events_pending() 方法可以知道事件堆栈是否为空,但是我想在下一个 gtk 循环周期之前操作挂起的事件并对其进行过滤,这些数据必须存储在某个地方,但是在哪里?
谢谢。
您可以自己控制事件循环。而不是调用gtk.main(),您可以使用gtk.main_iteration.
gtk.main()
gtk.main_iteration
你的循环可能是:
while running: #filter events here gtk.main_iteration(true)
请参阅此处了解更多信息。