Thursday, June 10, 2010

retrieving the size of a panel/widget before it is added

Hi,

when I add a VerticalPanel to the center of a DockLayoutPanel, it will
immediately be stretched to the remaining size of its parent. But I
would like it to keep its natural size, i. e. the size it needs for
its children (and then center it within its parent).

So I tried to get its size, before it is added:

VerticalPanel vp = new VerticalPanel;
//vp.add ...
int xs = p.getOffsetWidth();
int ys = p.getOffsetHeight();
add(vp);

But this size is 0.

So one of the following is needed:
- get the size of the panel before it's added
- prevent it from beeing stretched and then retrieve the size

Are there methods to do this?

Thanks
Magnus

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate