On May 4, 2006, at 9:47 AM, Adolfo González Blázquez wrote:
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:
signal = button.connect('clicked', on_button_play_clicked)
def on_menu_play_clicked(self, widget):
self.playing = not self.playing
button.handler_block(signal)
self.button_play.set_activated(self.playing)
button.handler_unblock(signal)
self.play()
def on_button_play_clicked(self, widget):
self.playing = not self.playing
self.play()
--
-- EMail: [EMAIL PROTECTED] Phone: (301)
975-5423 --
-- WWW: http://math.nist.gov/mcsd/Staff/SLanger/ Fax: (301)
975-3144 --
-- Mail: NIST; 100 Bureau Drive -- Stop 8910; Gaithersburg, Md
20899-8910 --
-- "I don't think this will work. That's why it's
science." --
-- Naomi Langer, 17 Feb
2003 --
_______________________________________________
pygtk mailing list pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/