Hi,
I'm trying to make a MenuBar. After having some troubles doing mine, I
tried to simply use google code, in the gwt javadoc, so I copied/
pasted this :
// Make a command that we will execute from all leaves.
Command cmd = new Command() {
public void execute() {
Window.alert("You selected a menu item!");
}
};
// Make some sub-menus that we will cascade from the top menu.
MenuBar fooMenu = new MenuBar(true);
fooMenu.addItem("the", cmd);
fooMenu.addItem("foo", cmd);
fooMenu.addItem("menu", cmd);
MenuBar barMenu = new MenuBar(true);
barMenu.addItem("the", cmd);
barMenu.addItem("bar", cmd);
barMenu.addItem("menu", cmd);
MenuBar bazMenu = new MenuBar(true);
bazMenu.addItem("the", cmd);
bazMenu.addItem("baz", cmd);
bazMenu.addItem("menu", cmd);
// Make a new menu bar, adding a few cascading menus to it.
MenuBar menu = new MenuBar();
menu.addItem("foo", fooMenu);
menu.addItem("bar", barMenu);
menu.addItem("baz", bazMenu);
RootPanel.get().add(menu);
The result is that I have my menuBar, with the three names "foo",
"bar" and "baz". However, when I click on one of these submenu,
nothing happens, and I can't go to the Items. Is there something to
configure or so to allow the opening ?
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---