[pygtk] Blocking signals from widgets

Jakob Kemi jakob.kemi@telia.com
Mon, 21 Oct 2002 17:48:57 +0200


Hi,

Assume that I've created a program where the "changed" signal emitted from 
spinbutton 'a' modifies the value of another spinbutton 'b' and vice versa. 
This of course leads to a loop since the spinbutton widgets keeps affecting 
each other. Is there some way to temporarily disable a widget from emitting 
a specific (or all signals, perhaps) signal.

So that I could write my program like this:

def on_a_changed(widget, *args):
	b.block_signal ("changed")
	b.set_value ( "something" )
	b.unblock_signal ("changed")

Thanks,
	Jakob Kemi