Magnus,

Jens is right: all you need is a simple FlowPanel with a Label and a button 
inside. Set the button style to "float: right", set its width (which, I assume, 
is constant), and add a right margin to your label which is wider than the 
button. That's it. Your generated code will be 10 times smaller (layout panels 
produce a lot of HTML), and your pages will reflow much faster.

You don't need to worry about the height: a FlowPanel will expand automatically 
to accommodate its contents. If you want, you can fix its height, or you can 
use min-height and/or max-height CSS rules. You can set a width of the 
FlowPanel in pixels or as percentage of its parent's width, or you can let it 
expand with the content up to a specified maximum. You can allow the content to 
wrap inside the widget, or you can force it to show ellipsis when the label 
gets too long, or you can force a scrollbar, etc. There are a lot of options 
available to you in CSS. I use layout panels only for page structure, and I 
never use HorizontalPanel or VerticalPanel - they offer nothing that cannot be 
easily done with FlowPanels and CSS, while they are less flexible as you have 
discovered.

My advice: when building a layout, forget about widgets. Think how you can do 
it in pure HTML/CSS, ideally without any <table> elements. Once you do it, the 
choice of widgets becomes obvious.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/obV8zXuKqaMJ.
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.

Reply via email to