Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to use a Menu Manager with SWT control
How to use a Menu Manager with SWT control [message #445133] Tue, 26 October 2004 14:22 Go to next message
Eclipse UserFriend
Originally posted by: miha_sarda.classys.net

Hello,
I have a problem!
Well I want to use a menu manager in a SWT composite (actually in a
multipage editor) and I do not know how. I have looked over it and I don't
find anything to which I can set a context menu provider my menu manager.
I have seen that I can set a menu, but I do not want this. I want
everytime the menu is about to show to modify its components (menu items).
What can I do?
Can anyone help me please!
Thanks,
mihai
Re: How to use a Menu Manager with SWT control [message #445291 is a reply to message #445133] Mon, 01 November 2004 17:11 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi Mihai,

There's no pre-defined concept of a menu manager at the swt level, so you'll
need to do the work. For an example of dynamically-created context menus
see:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet97.java?rev=HEAD&a mp;content-type=text/vnd.viewcvs-markup .

Grant

"mihai sarda" <miha_sarda@classys.net> wrote in message
news:cllmjr$7p6$1@eclipse.org...
> Hello,
> I have a problem!
> Well I want to use a menu manager in a SWT composite (actually in a
> multipage editor) and I do not know how. I have looked over it and I don't
> find anything to which I can set a context menu provider my menu manager.
> I have seen that I can set a menu, but I do not want this. I want
> everytime the menu is about to show to modify its components (menu items).
> What can I do?
> Can anyone help me please!
> Thanks,
> mihai
>
Re: How to use a Menu Manager with SWT control [message #445317 is a reply to message #445133] Mon, 01 November 2004 22:03 Go to previous message
Chris Gross is currently offline Chris GrossFriend
Messages: 471
Registered: July 2009
Senior Member
myComposite.setMenu(myMenuManager.createContextMenu(myCompos ite));

Is that what you're looking for?

-Chris
"mihai sarda" <miha_sarda@classys.net> wrote in message
news:cllmjr$7p6$1@eclipse.org...
> Hello,
> I have a problem!
> Well I want to use a menu manager in a SWT composite (actually in a
> multipage editor) and I do not know how. I have looked over it and I don't
> find anything to which I can set a context menu provider my menu manager.
> I have seen that I can set a menu, but I do not want this. I want
> everytime the menu is about to show to modify its components (menu items).
> What can I do?
> Can anyone help me please!
> Thanks,
> mihai
>
Previous Topic:Drawing
Next Topic:Please give SwtFox your vote! (=Faster eclipse for linux)
Goto Forum:
  


Current Time: Thu Sep 19 13:12:16 GMT 2024

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

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

Back to the top