-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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
[NativeMenu] Implement native popup menu support on Windows. #89273
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't check the code, but did some brief testing and it works correctly.
The documentation could use some code examples.
Added a usage example to the docs, also added |
[b]Note:[/b] This is low-level API, consider using [MenuBar] with [member MenuBar.prefer_global_menu] set to [code]true[/code], and [PopupMenu] with [member PopupMenu.prefer_native_menu] set to [code]true[/code]. | ||
To create a menu, use [method create_menu], add menu items using [code]add_*_item[/code] methods. To remove a menu, use [method free_menu]. | ||
[codeblock] | ||
var menu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this but how does anyone else feel about it, over the more explicit var menu = null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems redundant to me (at least for non-typed code, and all doc examples seems to be non-typed).
Thanks! |
This caused a regression in the macOS global menu: #89496 |
Partial
NativeMenu
(since there's no "global menu") for Windows, useful for status indicator (tray icon) context menus, but can be used with any popup (PopupMenu
).