[pygtk] Using a CheckButton on an applet Menu

Adolfo González Blázquez listas at infinicode.org
Wed Oct 11 20:07:33 WST 2006


Hello,

I sent an email [1] to this list about this problem in april, but got no
responses. I'm thinking now of trying to implement this in my applet, so
that's why i'm asking again.

The problem is that i have an applet [2], using the gnomeapplet pygtk
module. I build the applet context menu using the
gnomeapplet.setup_menu_from_file function, passing it a .xml file like
this:
<Root>
	<popups>
	<popup name="button3">
		<menuitem name="Alarm" verb="Alarm" _label="_Enable alarm"
pixtype="stock" pixname="gtk-apply"/>
		<separator/>
		<menuitem name="Prefs" verb="Prefs" _label="_Preferences"
pixtype="stock" pixname="gtk-properties"/>
		<menuitem name="About" verb="About" _label="_About" pixtype="stock"
pixname="gnome-stock-about"/>
		<menuitem name="Prueba" verb="Prueba" _label="Prueba" type="toggle"/>
	</popup>
	</popups>
</Root>

And i catch the signals from the menu options using this:
self.verbs = [("Alarm", self.menu_alarm_toggled),
	("Prefs", self.prefs.preferences_show), 
	("About", self.about_info),
	("Prueba", self.prueba)]
self.applet.setup_menu_from_file (glob.resources_dir,
		"computertemp_menu.xml", "computertemp", self.verbs)

Ths signals for the normal menu items (About, Prefs, Alarm) work ok, but
i can't catch the signal for the toggle menu item.
Has anybody idea of how to catch this signal??

Thank you very much!

-- adolfo

[1] http://www.daa.com.au/pipermail/pygtk/2006-April/012117.html
[2] http://computertemp.berlios.de/

-------------- 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/20061011/1b0909ee/attachment.pgp


More information about the pygtk mailing list