-
Notifications
You must be signed in to change notification settings - Fork 11
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
Menubar not showing when using CustomMenuItem #18
Comments
Hi! I think the reason is that custom menus are just not supported in combination with system menu bars https://github.com/openjdk/jfx/blob/c705bd493931d88650542be5466d6add359f45b9/modules/javafx.controls/src/main/java/javafx/scene/control/skin/MenuBarSkin.java#L881 On Windows, you probably don't use system menu bars (as AFAIK Windows doesn't support them at all), which is why it is working there. So I guess that this is less a NSMenuFX issue than a general JavaFX problem. NSMenuFX uses the system menu property of JavaFX to put menus into the macOS system menu bar. |
Hmmm, that is unfortunate. I was using CustomMenuItems so I could add tooltips to some of my menu items. Other than not using CustomMenuItems, do you know of any work-arounds for this? |
Hmm, apparently macOS menu items do support tooltips: https://developer.apple.com/documentation/appkit/nsmenuitem/1514848-tooltip?language=objc |
Thanks for looking into this. For now I will switch to use regular |
Windows does not seem to support tool tips either in its standard menus. May QT does this but not necessarily the windows standard framework. Haven't seen any macOS apps with tooltips in menus. If macOS supports this, then this would require an enhancement request for OpenJFX. |
When running my application on macOS, I noticed the Application menubar was not showing any more, and I saw the following in the console:
Warning: MenuBar ignored property useSystemMenuBar because menus contain CustomMenuItem
I recently added a submenu that uses CustomMenuItem. When I removed that, the menubar worked again.
I did some digging, and it looks like the warning message comes from the MenuBarSkin class:
On Windows (where I am not using NSMenuFX), using CustomMenuItem works fine. Is there some reason why CustomMenuItem doesn't work with NSMenuFX?
Thanks for your help.
The text was updated successfully, but these errors were encountered: