diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java')
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java index c5fe0d8261..e2c44cc4ba 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java @@ -290,6 +290,16 @@ void createItem (MenuItem item, int index) { } System.arraycopy (items, index, items, index + 1, itemCount++ - index); items [index] = item; + + /* + * Feature in Cocoa. If the NSMenuItem has NSMenu, it will not be shown in + * the menu bar. The fix is to create an empty menu then add it to the MenuItem. + */ + if (((style & SWT.BAR) != 0) && item.getMenu () == null) { + Menu emptyMenu = new Menu (parent, SWT.DROP_DOWN); + item.setMenu (emptyMenu); + } + } void createWidget () { |