15.3. Idle Methods

What if you have a method you want called when nothing else is happening?

Gtk.idle_add { method( data ) }

This causes GTK to call the specified method whenever nothing else is happening.

Gtk.idle_remove( tag )

I won't explain the meaning of the arguments as they follow very much like the ones earlier in the chapter. The method called by the first argument to Gtk.idle_add will be called whenever the opportunity arises. As with the others, returning false will stop the method from being called.


Prev Next