简体   繁体   中英

How to add a button to the main menubar in Gjs/Gtk

I've looked all over for documentation on how to add a button to the main menu bar, but all I've found is documentation regarding menu bars for application windows.

Can anyone point me in the right direction on what Gtk classes I should be using to pull this off? I added a screenshot of what I'm trying to do - I'd like to add an icon/button like the Discord icon in the screenshot.

https://prnt.sc/vg04vd

Depending on what you intend to do with this button, you could have a look at building a gnome-shell extension. They do however need installation and work only on the GNOME desktop environment.

You can find an example extension that adds an emoji button to your main panel here: https://gjs.guide/extensions/development/creating.html#a-working-extension

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM