2

I'm adding menu items to an appindicator. I don't want them to behave like ordinary menu items: I want them to have normal appearance, but not to respond to mouse hovers and mouse clicks.

How do I go about doing that? Trying to grab the events before gtk gets to them feels brittle - it feels like there should be a better way.

serge_gubenko
  • 20,186
  • 2
  • 61
  • 64
Erigami
  • 804
  • 1
  • 8
  • 20
  • I tried to create an 'appindicator' tag, but I don't have enough rep. If anyone's feeling generous, that would make this post more discoverable. – Erigami Feb 13 '11 at 05:36
  • low occurrence tags don't really make a question more discoverable. They are even [removed automatically after 6 months if they still have only a single use](http://meta.stackexchange.com/questions/48417/should-we-zap-the-low-occurrence-tags). If you want to make your question discoverable for people searching for "appindicator", then putting the word in the question text is sufficient. – Wim Coenen Feb 14 '11 at 11:07
  • Why would you want menu items that don't behave like menu items? That's a really terrible idea from a UI design perspective. – ptomato Feb 14 '11 at 12:40
  • @ptomato: It sure is. But that's the joy of appindicators. The only UI they're allowed to have is a menu, but they are used to show non-menu-y things (take a look at the Ubuntu sound indicator, for example). – Erigami Feb 14 '11 at 19:19

2 Answers2

1

I think that if you don't connect the "activate" or "clicked" event to any handler, the menu items will not respond to any click.

chavaone
  • 183
  • 3
  • 9
0

(sorry, not enough rep to add a comment to @chavaone answer)

As mentioned in the answer, create the menu item but just don't connect it to any handler code.

For example in my Ubuntu appindicator indicator-lunar, found here I have mostly menu items which are display text and do nothing when clicked.

Bernmeister
  • 267
  • 9
  • 17