Checking if gtk mainloop is running

Is there a way to check if a Gtk.main () loop exists? Like threading.is_alive () function? Any help is greatly appreciated :)

+3


source to share


1 answer


You can use the function Gtk.main_level()

:

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

      



In other words, a return value of 0 means that mainluop is not working.

+5


source







All Articles