Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checking to see if Gtk mainloop is running

Is there a way that I can check to see if the Gtk.main() loop is alive? Similar to the threading.is_alive() function? Any help is much appreciated :)

like image 265
Daniel Avatar asked Jun 23 '17 22:06

Daniel


1 Answers

You can use the Gtk.main_level() function:

 Gtk.main_level()
    Returns:    the nesting level of the current invocation of the main loop

In other words, a return value of 0 means no mainloop is running.

like image 190
Aran-Fey Avatar answered Nov 17 '22 23:11

Aran-Fey