right-click menu (bonobo UI) states
- From: Davide Alberani <davide alberani gmail com>
- To: gtk-app-devel-list gnome org
- Subject: right-click menu (bonobo UI) states
- Date: Fri, 11 Sep 2009 20:16:30 +0200
Hi,
I have a problem setting attributes like "sensitive" and "state" (for
radio buttons) in a right-click menu created using the bonobo UI XML.
For example, the Python code below - in large amount taken from the
documentation - doesn't show any entry in the menu.
Adding the label to the "menuitem" tag the label is shown, but the entry
is sensitive, despite the content of the "cmd" tag. :-/
I suppose I'm doing something wrong in the XML or maybe I forget to
call some method of the applet instance.
Does anyone have a working example of a "non sensitive" menu entry
created using an XML specification?
PS: no, it doesn't matter if the 'verb' has an associated call-back
or not. :-)
TIA.
=================================================================
#!/usr/bin/python
import gtk
import gnomeapplet
XML = """
<Root>
<commands>
<cmd name="baa" label="Our Label" sensitive="0" />
</commands>
<menu>
<menuitem name="foo" verb="baa" />
</menu>
</Root>"""
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.set_size_request(200, 200)
applet = gnomeapplet.Applet()
applet.setup_menu(XML, [], None)
applet.reparent(window)
window.show_all()
gtk.main()
=================================================================
--
Davide Alberani <davide alberani gmail com> [GPG KeyID: 0x465BFD47]
http://erlug.linux.it/~da/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]