0

the following Code runs under Ubuntu and Eclpise Oxygen.The Menu ist displayed. In Windows 10 and Eclipse Photon the Menu is not there. Is there any solution.

menuBar = new Menu(shell, SWT.BAR)
menuDefaultHeader = new MenuItem(menuBar, SWT.CASCADE)
menuDefaultHeader.setText("Default");

menuDefault = new Menu(shell, SWT.DROP_DOWN);
menuDefaultHeader.setMenu(menuDefault);

menuDefaultClock = new MenuItem(menuDefault, SWT.PUSH);
menuDefaultClock.setText("&Clock");
  • You should show us a proper [mcve] so that people can test this easily. Also note the Eclipse Photon is still only in pre-release Milestone builds and won't be finally released until June. If you must use Photon make sure you are on the newest milestone (currently 4.8M6) – greg-449 Apr 25 '18 at 16:32

1 Answers1

0

You need to either start with the Shell's existing menu bar from #getMenuBar() as the root of your menus, or explicitly set your created Menu with its BAR style as the new menu bar with #setMenuBar(). That it's worked so far is a combination of implementation details and blind luck.

See the example.

nitind
  • 19,089
  • 4
  • 34
  • 43