开发者

python glib main loop: delaying until loop is entered

Is t开发者_开发问答here a way to schedule the execution of a callable until the glib main loop is entered?

Alternatively, is there a signal I can subscribe to that will indicate that the main loop is entered?


You can use gobject.idle_add which will schedule a callable to be executed when the main loop is idle. gobject.timeout_add is an alternative which uses a timer.

Mind that the callable will be called again and again, unless is returns False (or anything that resolves to False, like None).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜