Creating menu items at runtime [message #948818] |
Thu, 18 October 2012 12:05 |
Gennady Gromov Messages: 24 Registered: May 2011 |
Junior Member |
|
|
Hello, all!
I tried to add new menu item dynamically to the "File" menu of the main menu:
MDirectMenuItem item = MMenuFactory.INSTANCE.createDirectMenuItem();
item.setLabel("LABEL");
fileMenu.getChildren().add(item);
After execution of this code, there is no result. The main menu is unchanged. This code I read in tuorials.
May be it is necessary to execute something else to force updating the menu?
I tried to add
item.setToBeRendered(true);
item.setVisible(true);
E4Workbench.processHierarchy(application);
no effect.
[Updated on: Thu, 18 October 2012 12:18] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02825 seconds