Thanks Ian,

To test the effect of using an absolute size I replaced this line:
    basePanel.setSize("100%", "100%");
with this:
    basePanel.setPixelSize(200, 200);

The new output in compiled mode still shows appPanel and bodyPanel
with the same dimensions.

root 1103 200
basePanel 200 200  <-- good, this is what I specified in my new
version.
logPanel 78 200       <--  good, I requested 30% of basePanel's width.
appPanel 122 200     <--  good, I requested 70% of basePanel's width.
bodyPanel 122 200    <--- ???  I expected 50% of appPanel's height.

John


On Oct 17, 7:10 pm, "Ian Bambury" <[EMAIL PROTECTED]> wrote:
> Hi John,
> Your basic problem is that you don't have an absolute height for anything in
> there.
>
> Any percentage of zero is zero and, depending on which browser you use, you
> will get an override/default of some sort.
>
> Another problem is that the bodyPanel doesn't have any content, and some
> browsers won't show empty divs (although they will probably show a div that
> contains an empty div that isn't being shown - still with me? :-)
>
> Ian
>
> http://examples.roughian.com
>
> 2008/10/17 JohnMudd <[EMAIL PROTECTED]>
>
>
>
> > I have a large application and deep in the nested panels there's a
> > problem where a panel size doesn't seem to obey the requested size.
> > It works as expected up to the size of bodyPanel.  The bodyPanel panel
> > ends up with the same height as appPanel.  Shouldn't it be 50% of
> > appPanel's weight instead?
>
> > Here's my sample program.  I tried to eliminate as much as possible
> > and still reproduce the problem.  I using gwt-linux-1.4.62
>
> > ----------------------------------------------------------------------------
> > package com.mudd.client;
>
> > import com.google.gwt.core.client.EntryPoint;
> > import com.google.gwt.core.client.*;
> > import com.google.gwt.user.client.ui.*;
> > import com.google.gwt.user.client.*;
>
> > public class panelSizeDemo implements EntryPoint {
>
> >  public void onModuleLoad() {
> >    try {
> >      main();
> >    }
> >    catch (Exception e) {
> >      log(e.getMessage());
> >      Window.alert("General Error:\n" + e);
> >    }
> >  }
>
> >  static RootPanel root = RootPanel.get();
> >  static HorizontalPanel basePanel = new HorizontalPanel();
> >  static VerticalPanel logPanel = new VerticalPanel();
> >  static VerticalPanel appPanel = new VerticalPanel();
> >  static VerticalPanel bodyPanel = new VerticalPanel();
>
> >  public void main() {
> >    root.add(basePanel);
> >    basePanel.setSize("100%", "100%");
>
> >    basePanel.add(logPanel);
> >    basePanel.setCellWidth(logPanel, "30%");
> >    basePanel.setCellHeight(logPanel, "100%");
> >    logPanel.setSize("100%", "100%");
>
> >    basePanel.add(appPanel);
> >    basePanel.setCellWidth(appPanel, "70%");
> >    basePanel.setCellHeight(appPanel, "100%");
> >    appPanel.setSize("100%", "100%");
>
> >    appPanel.add(bodyPanel);
> >    appPanel.setCellWidth(bodyPanel, "100%");
> >    appPanel.setCellHeight(bodyPanel, "50%");   // Why doesn't this
> > have an effect?
> >    bodyPanel.setSize("100%", "100%");
>
> >    log("root "+root.getOffsetWidth() + " "+root.getOffsetHeight());
> >    log("basePanel "+basePanel.getOffsetWidth() + "
> > "+basePanel.getOffsetHeight());
> >    log("logPanel "+logPanel.getOffsetWidth() + "
> > "+logPanel.getOffsetHeight());
> >    log("appPanel "+appPanel.getOffsetWidth() + "
> > "+appPanel.getOffsetHeight());
> >    log("bodyPanel "+bodyPanel.getOffsetWidth() + "
> > "+bodyPanel.getOffsetHeight());
> >  }
>
> >  public static void log(String msg) {
> >    logPanel.add(new Label(msg));
> >  }
> > }
>
> > ----------------------------------------------------------------------------------------------------------
>
> > Output in compile mode:
>
> > root 1103 656
> > basePanel 1103 656
> > logPanel 331 656
> > appPanel 772 656
> > bodyPanel 772 656  <-- why does this match appPanel's size?
>
> > Ultimately I only care about the results in compile mode but here's
> > output in shell mode for reference.
>
> > root 774 445
> > basePanel 774 445
> > logPanel 232 445
> > appPanel 542 445
> > bodyPanel 0 0
>
> > John
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to