How to use Ubuntu Unity global menu in GTK#?
Asked Answered
T

1

9

I'm developing a simple GTK# application(nothing serious, just a little project), and I've noticed my application menu bar is showing in my application window instead of Ubuntu's Unity global menu bar.

Is there any way to make the menu bar show up in the unity menu bar? I've tried to google a bit but most results seem to be about disabling this behavior - I want to enable it.

Currently, I'm adding the menu bar to a VBox, via MonoDevelop's visual editor.

Telemeter answered 24/11, 2011 at 16:45 Comment(1)
I just discovered that the Pinta application does have a global menu. This might be a good clue.Telemeter
T
4

Somehow, the application works fine without any changes.

My menubar is in a vbox which is the only child of the main window I created. It is the first element of the vbox, not sure if that affects anything.

And here's what I noticed:

I asked this question because when I clicked "Run" on MonoDevelop, the menu bar showed up in the window instead of being global.

However, when I run it directly from the command-line mono [myappname].exe, it works just fine. Not sure what's going on here.

So apparently the Unity devs made it easy to use the global menu bar automatically, but somehow MonoDevelop does something that disables this behavior when the app is run from MD. Not sure if it is a bug of MD, expected behavior or if there's some gotcha going on here.

Since the application is only run from MD for testing purposes, I'm accepting it the way it is now.

Telemeter answered 1/12, 2011 at 0:32 Comment(1)
Yes, I can observe the same behavior in Ubuntu 14.04 and "compiling" my application using Monodevelop 4.0 as my IDE, so it still continue working the same way 3 years later.Winifredwinikka

© 2022 - 2024 — McMap. All rights reserved.