Hi Roger,

Adding an empty <Menu/> tag underneath seems to have fixed it. Visually it's a 
little strange if you look closely, as it does look like it *should* have a 
menu beneath it but doesn't. Not a deal breaker for what I'm doing though so 
I'm OK with it. Could be an improvement for a future version!

Thanks for your help.

Joseph.

On 21/11/2012, at 9:44 AM, "Roger L. Whitcomb" <[email protected]> 
wrote:

> Ah, I see what is happening.  In MenuBar.java at line 162 (inside “isEnabled) 
> it is checking for a null Menu item.  So, the MenuBar is definitely assuming 
> that every MenuBar.Item will itself contain a Menu.  I wonder what would 
> happen if you were to define an empty Menu (as in <Menu/>) underneath your 
> MenuBar.Item …. Probably wouldn’t be very nice visually ….
>  
> I’m not sure how to suggest working around this otherwise….
>  
> ~Roger Whitcomb
>  
> From: Joseph Paterson [mailto:[email protected]] 
> Sent: Tuesday, November 20, 2012 2:32 PM
> To: [email protected]
> Subject: Re: Simple button in MenuBar
>  
> Hi Roger,
>  
> The action is definitely enabled and works fine if it is contained within an 
> enclosing menu. My menu bar has plenty of MenuBar.Item with menus within them 
> which work fine, but what I want is to have a button to access an action 
> directly on the menu bar, not within a menu on the menu bar (if that makes 
> sense), a bit like a toolbar if you like.
>  
> Cheers,
>  
> Joseph.
>  
>  
> On 21/11/2012, at 4:48 AM, "Roger L. Whitcomb" <[email protected]> 
> wrote:
> 
> 
> Hi Joseph,
>    I’ve never seen this before, and our application has a lot of menu bar 
> stuff.  Can you do some debugging or some debug printouts to verify that the 
> action has not been disabled by some other means?  What happens if you change 
> the action on this item to something else?
>  
> ~Roger Whitcomb
>  
> From: Joseph Paterson [mailto:[email protected]] 
> Sent: Saturday, November 17, 2012 11:08 PM
> To: [email protected]
> Subject: Simple button in MenuBar
>  
> Hi all,
>  
> My application contains a MenuBar in which I would like to place a simple 
> button (to give easy access to a particular action), and I'm not sure how to 
> do this. I've got the following code:
>  
>     <MenuBar>
>             […]
>       <MenuBar.Item action="refresh">
>         <buttonData>
>           <content:MenuItemData text="Refresh" 
> icon="/icon/refresh_16x16.png"/>
>         </buttonData>
>       </MenuBar.Item>
>     </MenuBar>
>  
> With the code above I do get something appearing in the menu bar, but it is 
> disabled (the "refresh" action is enabled).
>  
> Any help would be greatly appreciated!
>  
> Thanks,
>  
> Joseph.

Reply via email to