[pygtk] Toggle menu item and toggle button syncronized

Adolfo González Blázquez agblazquez at telefonica.net
Thu May 4 21:47:07 WST 2006


Hello,

I'm trying to syncronize a toggle menu item, and a toggle button, so
when one of them is activated, the other one gets activated as well.

The problem comes when cliking the menu item, i try to activate the
button, and this catch the 'clicked' signal, so it tries to activate the
menu, and that si a kind of infinite loop. 
Maybe i'm not explaining myself clearly...

The code is like this:

def on_menu_play_clicked(self, widget):
	self.playing = not self.playing
	self.button_play.set_activated(self.playing)
	self.play()

def on_button_play_clicked(self, widget):
	self.playing = not self.playing
	self.play()


Which changes should i made to the code?
Maybe this is a stupid question, but now i can't find myself the
answer...

Thank you very much in advance!

-- adolfo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada
	digitalmente
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20060504/d5914021/attachment.pgp


More information about the pygtk mailing list