Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Putting any gtk.Widget inside a gtk.Menu works, somewhat, by putting an empty gtk.MenuItem in first. It doesn't seem to be reliable - but it basically works. With an appindicator.Indicator, it doesn't work. The entry just stays empty. Even if you set the child[border_size] to 32, for example.

The only widget that works is a gtk.Label (plus the MenuItem, ImageMenuItem and so on of course).

Now the Me Menu has got a gtk.Entry in it, so it must surely be possible to do this Properly. How do I do it?

Here's some example code to explain what I'm on about:

    self.item = gtk.MenuItem()
    self.item.add(gtk.Label("hello world!"))

The above code works, this however doesn't:

    self.item = gtk.MenuItem()

Where is an appindicator.Indicator, if it were a gtk.Menu, the Entry would be at least displayed.

Here's some working code:

import gtk
import appindicator

class AppIndicator (object):

    def __init__(self):
        self.ind = appindicator.Indicator("hello world client",
            "distributor-logo", appindicator.CATEGORY_APPLICATION_STATUS)
        self.ind.set_status (appindicator.STATUS_ACTIVE) = gtk.Menu()
        item = gtk.MenuItem()

        item.add(gtk.Label("hello world"))
        # item.add(gtk.Entry())

indicator = AppIndicator()
share|improve this question
As @MarcoCeppi reminded me, yes - this isn't supposed to work. I'm just hoping and dreaming, maybe it can. Since the Me Menu does something seemingly similar. – Stefano Palazzo Dec 6 '10 at 14:47
I'm pretty sure that the Me Menu makes use of libido (Indicator Display Objects) to do that. See: In particular, idoentrymenuitem.c (…). Unfortunately, I don't think there are python bindings. You might want to ask on the ayatana-dev email list. – andrewsomething Dec 21 '10 at 16:22
Did you find out how to do this? I am facing the same problem. Thanks. – Benjamin Oct 6 '13 at 16:22
up vote 6 down vote accepted

The Application Indicator menu support is based on D-Bus menus, which are limited in what they support - they only support basic menu functionality, not more exotic things such as arbitrary widgets.

One significant roadblock to them ever supporting such things is the fact that the application indicator menu is rendered by a different process, the application indicator process, so your program doesn't have access to directly draw anything on it. Overcoming this would require either supporting something like X-Embed in D-Bus menus or allowing all of GTK to work over D-Bus.

share|improve this answer

The sound indicator in Ubuntu has sliders for the volume and I wondered how that is possible. After a look in the code it seems there are GtkMenus which can be filled via dbus meanwhile:

But I don't know how to use them. Wanted to write a sound indicator where I can control the volume per-app just like pavucontrol can do it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.