Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to update menu items from go? #12

Open
lox opened this issue Oct 17, 2016 · 5 comments
Open

Possible to update menu items from go? #12

lox opened this issue Oct 17, 2016 · 5 comments

Comments

@lox
Copy link

lox commented Oct 17, 2016

I'd like to update a menu item with a status, is this possible?

@dmitshur
Copy link
Member

Right now, no. It's possible to dynamically enable/disable menu items via MenuItem.Enabled func (because I needed that functionality, so I implemented it), but Title is permanent.

Adding the ability to do this is very logical and I'd be glad to support it.

@lox
Copy link
Author

lox commented Oct 17, 2016

Ok cool, I will have a look at it.

@dmitshur
Copy link
Member

Thanks! But please discuss the API here before doing a lot of work.

@captncraig
Copy link

My idea is to add a top level function UpdateMenu(newItems []MenuItem) that will essentially clear all items and add them anew.

Will add a simple void add_menu_item() to each platform implementation.

On OSX, can use https://developer.apple.com/reference/appkit/nsmenu/1518234-removeallitems. Not sure what to use on win/linux.

Will implement and test.

@captncraig
Copy link

Done some work in #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants