MenuBar - how can I cause it to wrap?

27 views
Skip to first unread message

King_V

unread,
Nov 9, 2011, 11:37:14 AM11/9/11
to Google Web Toolkit
All,

Ok, playing around with GWT in general, MenuBar right now in
particular.

I have a situation where a demo app screen I have is more or less
looking how I want it to.

But, I have an issue with MenuBar, and didn't know if there was a
simple way around it. If the user shrinks the screen so that all the
menu items in the MenuBar don't fit horizontally, they do NOT wrap as
you'd expect in a standard application, but instead simply get cut
off.

Is there a way to get the MenuBar to wrap its contents if there's not
enough horizontal space for them to fit on a single line?


The structure of my screen is:

RootPanel
- DockLayoutPanel
- - DockPanel (addStyleName used to give a style that sets width:
100%;)
- - - NORTH - MenuBar
- - - SOUTH - FlowPanel (addStyleName used to give a style that sets
position:absolute; bottom: 0;)

Thanks in advance!

King_V

unread,
Nov 9, 2011, 12:51:00 PM11/9/11
to Google Web Toolkit
Uh, let me clarify my structure - what I've described above is more or
less accurate, but the DockPanel is specifically the CENTER item of
the DockLayoutPanel.

Also, I should mention that the individual items will wrap in the menu
bar (ie: an item that is called "File Menu" rather than just "File"
will break the two words into two lines if need be), but the MenuBar
tries to force everything to be a single row.

Other than that, the rest of my post applies. Sorry for any confusion.

Danny Kirchmeier

unread,
Nov 9, 2011, 1:32:06 PM11/9/11
to google-we...@googlegroups.com
The MenuBar uses a table, with each item being a table cell. AFAIK, you're not going to have any luck getting that to wrap. 

You should be able to check to see if any of the items are flowing out of the window and have those move themselves into a "More" menu item. 
Reply all
Reply to author
Forward
0 new messages