4.1. More on Signal Handlers

There are a few things you probably noticied in the previous examples that may need a little explaining. Let's take another look at the #signal_connect method again.

GLib::Instantiatable#signal_connect( name, data ) { |widget, data| callback_method }

As stated before, you can have as many callbacks per signal and per object as you need, and each will be executed in turn, in the order they were attached.

This tag allows you to remove this callback from the list by using:

GLib::Instantiatable#signal_handler_disconnect

So, by passing in the widget you wish to remove the handler from, and the tag returned by one of the signal_connect methods, you can disconnect a signal handler.

You can also temporarily disable signal handlers with the GLib::Instantiatable#signal_handler_block and GLib::Instantiatable#signal_handler_unblock methods.

GLib::Instantiatable#signal_handler_block
GLib::Instantiatable#signal_handler_unblock

Prev Next