Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Expand Mac application menu with custom MenuItem(Adding menu items to standard Mac application menu?)
Expand Mac application menu with custom MenuItem [message #637736] Mon, 08 November 2010 10:39 Go to next message
Eclipse UserFriend
Hi everybody,

I want to add another menu item to Mac application menu of my SWT application. Currently I'm using a bit modified version of CocoaUIEnhancer for setting custom (localized) strings to Mac application menu and for hooking actions, such as displaying about and preferences windows and quitting the application.

All this works without problems, but now I seem to be stuck with adding another MenuItem to the application menu.

I think once I'll manage to add this extra MenuItem, hooking the appropriate action won't be difficult, but I don't have an idea how to add another menu item at all.

Any advice would be appreciated.


Best regards,

Albert

[Updated on: Mon, 08 November 2010 10:41] by Moderator

Re: Expand Mac application menu with custom MenuItem [message #637950 is a reply to message #637736] Tue, 09 November 2010 07:57 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

A new API will be available in eclipse 3.7 (3.7M3) to get the application menu bar on mac (cocoa). You can add your menu items to this menu bar. Please see this example snippet --> Snippet347
If you are using earlier versions, then you need to create a menu bar and add it to the main shell of your application. Example snippet --> Snippet 29

HTH,
Re: Expand Mac application menu with custom MenuItem [message #637972 is a reply to message #637950] Tue, 09 November 2010 09:02 Go to previous messageGo to next message
Eclipse UserFriend
Hi, Lakshmi,

thank you for your fast answer. But this is not what I was looking for, since I need a way to access Application menu on Mac (in your snippet labeled as "SWT") and add new MenuItems to it. Or am I perhaps missing something here?


Best regards,

Albert
Re: Expand Mac application menu with custom MenuItem [message #638049 is a reply to message #637972] Tue, 09 November 2010 13:12 Go to previous messageGo to next message
Eclipse UserFriend
On 09/11/10 7:32 PM, Albert wrote:
> Hi, Lakshmi,
>
> thank you for your fast answer. But this is not what I was looking for,
> since I need a way to access Application menu on Mac (in your snippet
> labeled as "SWT") and add new MenuItems to it. Or am I perhaps missing
> something here?

The API you are expecting is not yet introduced. Please see:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=329456
https://bugs.eclipse.org/bugs/show_bug.cgi?id=153761

--
- Prakash
Platform UI Team, IBM

www.eclipse-tips.com
Re: Expand Mac application menu with custom MenuItem [message #638167 is a reply to message #638049] Wed, 10 November 2010 04:42 Go to previous message
Eclipse UserFriend
Hi, Prakash,

thank you for your answer, I looked at the bug reports from your links. Do you have any information on this API, can it be expected to come with stable release of 3.7.?


Thanks again, best regards,

Albert


Prakash G.R. wrote on Tue, 09 November 2010 13:12
On 09/11/10 7:32 PM, Albert wrote:
> Hi, Lakshmi,
>
> thank you for your fast answer. But this is not what I was looking for,
> since I need a way to access Application menu on Mac (in your snippet
> labeled as "SWT") and add new MenuItems to it. Or am I perhaps missing
> something here?

The API you are expecting is not yet introduced. Please see:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=329456
https://bugs.eclipse.org/bugs/show_bug.cgi?id=153761

--
- Prakash
Platform UI Team, IBM

www.eclipse-tips.com

Previous Topic:why is not JFace based on generics?
Next Topic:GTK 2.22.0 (Ubuntu 10.10) Eclipse 3.5.2 performance problem
Goto Forum:
  


Current Time: Tue Jul 08 02:52:36 EDT 2025

Powered by FUDForum. Page generated in 0.04061 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top