G
Gregory Millam
I'm writing a script based off a ruby-gtk2 extension, and I'd like to know if there exists a standard (or ruby-gtk2 built in) method of exiting the program only after the last window closes. There isn't one main window that controls the rest, but several windows open in parallel.
If this was solely for my own application, I could keep a running track of open windows with an array, making each window delete itself from the array and calling Gtk.main_quit if there are no more objects in it. But this obviously isn't too portable across scripts; it is too unlikely that another coder who's going to use my script will use the same method.
So ... is there any consistent method of forcing main_quit to be called only if there are no more guis displaying, timer events, etc?
If this was solely for my own application, I could keep a running track of open windows with an array, making each window delete itself from the array and calling Gtk.main_quit if there are no more objects in it. But this obviously isn't too portable across scripts; it is too unlikely that another coder who's going to use my script will use the same method.
So ... is there any consistent method of forcing main_quit to be called only if there are no more guis displaying, timer events, etc?