pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gk_br...@verizon.net>
Subject Re: help with menus
Date Wed, 06 Apr 2011 20:30:12 GMT
I tried this myself and it worked for me. What is the problem you are running into?

On Apr 6, 2011, at 4:14 PM, Luís Eduardo wrote:

> 
> 
>    Thanks Greg.   It worked.  (more or less)
> 
> 
> 
> Em 06/04/2011 15:59, Greg Brown escreveu:
>> You need to add the items to the menu bar's items collection:
>> 
>>     mb.getItems().add(iFile);
>>     mb.getItems().add(iHelp);
>> 
>> 
>> On Apr 6, 2011, at 2:38 PM, Luís Eduardo wrote:
>> 
>>>    Hi,
>>> 
>>>    I am struggling with simple menus in Pivot.
>>>    What i need is to programmatic construct the menus.
>>>    What is wrong with this code???
>>>    Although the frame opens, the menu never shows.  (grrr)
>>> 
>>> 
>>> @Override
>>>    public void startup(Display display, Map<String, String>  properties)
throws Exception {
>>>        frame = new Frame();
>>>        frame.setPreferredSize(new Dimensions(800, 600));
>>> 
>>>        MenuBar mb = new MenuBar();
>>>        Item iFile = new Item("File");
>>>        Item iHelp = new Item("Help");
>>>        mb.add(iFile);
>>>        mb.add(iHelp);
>>>        frame.setMenuBar(mb);
>>>        // mb.setShy(false)  // dammit
>>> 
>>>        frame.open(display);
>>>    }
>> 
> 


Mime
View raw message