Closed msgilligan closed 8 years ago
Hi! Thing is, I don't actually use any SWT stuff... This comes in by eclipse swt from which I just use the cocoa native bindings. I'm currently working on a solution that uses neither SWT nor Swing but just JavaFX classes. This is however not so straight forward as it requires some reflections due to restricted access and one also looses the capability to rename the application menu (although this currently not ideal...)
So before switching to Swing, I'd like to try out a pure JavaFX solution. I'll push that on a branch within the next days so you can try it out if you like.
What I'm looking for:
com.apple.eawt.Application
or whatever.Additional nice to haves:
I now pushed a pure JavaFX implementation on a branch https://github.com/codecentric/NSMenuFX/tree/pure-javafx It is basically a complete rewrite of the existing project, so have a look at the test samples and/or the readme first. It'd be nice if you could give me some feedback.
What exactly do you mean by syncing the menu bar state? That the menu bar of all stages is updated when changing the menu bar of one stage? If so, I think this could be added without much effort.
Any I'm not a Windows user, so I'm not sure what exactly the Windows menu is :wink: Is that a menu you have in your start menu?
I spent some time trying to use Swing (com.apple.eawt.Application
) with JavaFX without much success. With an understanding of the internals (which I currently lack) it may be possible to make it work, but it's certainly no "slam dunk". (The next thing to try on this front is using FX without a primaryStage
.)
It'd be nice if you could give me some feedback.
I was able to check out and run the samples on Yosemite via IntelliJ. I'd like to see a sample that looks like a standard Mac OS X app (e.g. what you get when you use the Mac OS X application template in Xcode) (This is preliminary feedback, I'll provide more in a few days)
What exactly do you mean by syncing the menu bar state? That the menu bar of all stages is updated when changing the menu bar of one stage?
Yes. I want to build a multi-window app that works like a real Mac application. The menu bar can change when the front window changes, but many parts of it are the same and need to be kept in sync.
I'm not sure what exactly the Windows menu
It's the standard Window menu on Mac OS X described in OS X Human Interface Guidelines.
Is JDK-8091517 essentially what you are doing here? Is submission to OpenJFX a possible future goal?
Ah, now I got it :wink: Yes, the window menu is certainly a good idea and should be possible. I'll try to complete the sample App from your PR. Submitting to OpenJFX is certainly an option. Thx for the link to the ticket, I'll see if I can contribute something.
Just pushed some changes adding a global menu bar sync and a window menu. It's all added to your example
Cool. When do you think you might publish a JAR to jcenter or Maven Central?
should be there!
<dependency>
<groupId>de.codecentric.centerdevice</groupId>
<artifactId>centerdevice-nsmenufx</artifactId>
<version>2.0.0</version>
</dependency>
This is somewhere in-between a question and a feature request. A little of both I guess.
Why use SWT instead of Swing? Since Swing is bundled with the JRE, couldn't Swing be used to build the Mac OS menus in the same way you are doing with SWT. Then there would be no external dependencies -- especially natively compiled ones.