Are you changing the sizes of the layoutPanels dynamically? Because if you don't it should work out of the box. If you are changing it dynamically then you might run into this bug (http://code.google.com/p/google-web-toolkit/issues/detail?id=7188). I found following code snippet in one of my projects:
layoutPanel.setWidgetSize(this.asWidget(), size); /*workaround for bug http://code.google.com/p/google-web-toolkit/issues/detail?id=7188*/ layoutPanel.animate(0,new AnimationCallback() { @Override public void onLayout(Layer layer, double progress) { } @Override public void onAnimationComplete() { layoutPanel.forceLayout(); } });; On the other hand if you have simple elements (like in your use case) you could just rely on CSS settings (float, etc) as Andrei pointed out, although depending on your actual use case you might have to calculate the sizes and set them explicitly. On Mon, Sep 3, 2012 at 4:24 PM, Magnus <[email protected]> wrote: > > Am Montag, 3. September 2012 10:09:45 UTC+2 schrieb Ümit Seren: >> >> How about using nested LayoutPanels? Or if you don't want to use >> LayoutPanels all the way but need resizing in one of the inner widget you >> could wrap it in a >> http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/ResizeLayoutPanel.html. >> > > > Hi, > > I am using LayoutPanels, and found out the following while debugging within > GWT code: > > When setting the sizes of a widget using the methods of LayoutPanel > (setWidgetLeftWidth, and so on), the widget's onResize is not called. So I > call it manually right after setting its sizes. But then, the new sizes are > not known yet. > The several calls to setWidgetLeftWidth and others just seem to collect > information, but the real resizing is done later. (I foudn something with a > Scheduler, but I don't know what it does.) > > > So there are two questions: > > > > - Do I really have to call the widget's onResize manually, after setting its > size using the LayoutPanel's methods? > > - How can I schedule this call, so that the widget's onResize is called > after its parent has been resized? > > > > Magnus > > -- > 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/-/TEK0iLk4aYkJ. > > 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. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. 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.
