How do I prevent a menu item from responding to a mouse over (without making it insensitive)?

167 Views Asked by At

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.

2

There are 2 best solutions below

0
On

(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.

0
On

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.