summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java
diff options
context:
space:
mode:
authorKevin Barnes <krbarnes>2008-02-25 19:34:19 +0000
committerKevin Barnes <krbarnes>2008-02-25 19:34:19 +0000
commitbb7d6277c4df65eeb3d89017add0f14480095c41 (patch)
treed75b541a37f14efc4641860319442994cea4ec44 /bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java
parent0262f2043050ffa95129a1b98153a0304c364772 (diff)
downloadeclipse.platform.swt-bb7d6277c4df65eeb3d89017add0f14480095c41.tar.gz
eclipse.platform.swt-bb7d6277c4df65eeb3d89017add0f14480095c41.tar.xz
eclipse.platform.swt-bb7d6277c4df65eeb3d89017add0f14480095c41.zip
210430 - Shell.setMenuBar() does not work
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java10
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 () {