|
I am writing a plugin which extends a StackWindow with some additional control buttons added above the imageCanvas. That is all working fine on Windows, Linux and Mac. I also add a menuBar (NOT JmenuBar) to the extended StackWindow, and that works fine for Windows and Linux. On the Mac (with OSX 10.5.8 and java 1.5.0_30 (32-bit)), almost everything works. When ImageJ is opened, its menuBar shows up in the Mac screenMenuBar (Mac's common menu bar) as expected, and when an image is opened (with a menuBar added to the extended StackWindow), its menuBar replaces the ImageJ menuBar as expected. After clicking on the ImageJ toolbar, its menuBar reappears in the screenMenuBar. All is fine so far.
The problem occurs next. After opening an image, clicking the ImageJ toolbar, and then reclicking on the the extended StackWindow, the extended StackWindow menuBar never returns to the Mac screenMenuBar. I can not find any way to get it to display again.
I have tried to work around the problem by using all of the following to keep the StackWindow's menuBar attached to the StackWindow frame and not to the screenMenuBar, but none of these combinations make that happen. The StackWindow's menuBar always goes to the screenMenuBar. I have placed this code in in several places including ImageJ.java, ImageWindow.java (custom IJ compile), and my extended StackWindow code. I am trying the variety of setProperty commands, becasue I am not sure what the proper one is for recent java builds.
System.setProperty("com.apple.macos.useScreenMenuBar", "false");
System.setProperty("apple.laf.useScreenMenuBar", "false");
System.setProperty("apple.awt.useScreenMenuBar", "false");
I have also tried modifying the info.plist file in the Mac distribution to set the following to both true and false. In each case, the above behavior persists. I have also tried the other two statements above in the info.plist file.
<key>com.apple.macos.useScreenMenuBar<\key>
Does anyone have any ideas on how to get either the extended StackWindow's menuBar to stay attached to the extended StackWindow, or to work properly in the screenMenuBar?
I have searched for answers for a couple of days now, with no luck. I am hoping someone will embarrass me with an easy fix (or even a hard one)!
Thanks,
Karen
|