Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Eclipse 3.1 : dynamic menu from menu bar
Eclipse 3.1 : dynamic menu from menu bar [message #461061] Thu, 15 September 2005 11:33 Go to next message
Philippe Hordonneau is currently offline Philippe HordonneauFriend
Messages: 3
Registered: July 2009
Junior Member
I would like to change the menu of the File menu item of the menu bar of my
application (dynamic menu).

Apparently, it's neither possible to empty the menu, to remove a menu item,
nor to render invisible an item:
So functions like these:
aMenu.removeItem(i);
aMenuItem.setVisible(false);
do not exist.

So i have tryed to construct another menu when the item is armed.

public void widgetArmed(ArmEvent e) {
MenuItem anItem = (MenuItem) e.widget;
anItem.setMenu(menuRunnable.run(anItem));
}

It will be fine if the menu wasn't displayed at (0,0) of the window, not
just below the file menu item.

Any idea?

Thanks for your help
Re: Eclipse 3.1 : dynamic menu from menu bar [message #461070 is a reply to message #461061] Thu, 15 September 2005 13:05 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Philippe Hordonneau wrote:
> I would like to change the menu of the File menu item of the menu bar of my
> application (dynamic menu).
>
> Apparently, it's neither possible to empty the menu, to remove a menu item,
> nor to render invisible an item:
> So functions like these:
> aMenu.removeItem(i);
> aMenuItem.setVisible(false);
> do not exist.

If you want a menu item to disappear, can't you just use
aMenuItem.dispose() ... that should remove it from the menu.

Later,
PW


Previous Topic:Layouts
Next Topic:TreeViewer does not scroll
Goto Forum:
  


Current Time: Mon Aug 19 10:47:35 GMT 2019

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

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

Back to the top