Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 15:39 Go to next message
Albert Pikus is currently offline Albert PikusFriend
Messages: 70
Registered: October 2009
Member
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 15:41]

Report message to a moderator

Re: Expand Mac application menu with custom MenuItem [message #637950 is a reply to message #637736] Tue, 09 November 2010 12:57 Go to previous messageGo to next message
Lakshmi ShanmugamFriend
Messages: 275
Registered: July 2009
Location: India
Senior Member
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,


Lakshmi P Shanmugam
Re: Expand Mac application menu with custom MenuItem [message #637972 is a reply to message #637950] Tue, 09 November 2010 14:02 Go to previous messageGo to next message
Albert Pikus is currently offline Albert PikusFriend
Messages: 70
Registered: October 2009
Member
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 18:12 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
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 09:42 Go to previous message
Albert Pikus is currently offline Albert PikusFriend
Messages: 70
Registered: October 2009
Member
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:[Tree] unwanted automatic SelectionEvents
Next Topic:why is not JFace based on generics?
Goto Forum:
  


Current Time: Tue Oct 17 11:29:27 GMT 2017

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

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