diff options
author | Kevin Barnes <krbarnes> | 2008-02-25 19:34:19 +0000 |
---|---|---|
committer | Kevin Barnes <krbarnes> | 2008-02-25 19:34:19 +0000 |
commit | bb7d6277c4df65eeb3d89017add0f14480095c41 (patch) | |
tree | d75b541a37f14efc4641860319442994cea4ec44 /bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java | |
parent | 0262f2043050ffa95129a1b98153a0304c364772 (diff) | |
download | eclipse.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-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 () { |