Thanks. The new doctype changed the output but, as you guessed, the effect is interesting but not what I wanted. The panels collapsed to minimum size.
My basic problem is layout. I just need to nest panels without unexpected results. I've given up on auto-resize. I'll either write code to do that myself or just deliver an app that doesn't resize. Yes, in this sample I was trying for a HP with 2 cells, one 30% and one 70% and full height. FWIW, I think I see the problem with the above code. The height that I requested for the logPanel was two pixels too tall for it's parent panel, basePanel. That forced basePanel to grow in height by two pixels which led to the need for the vertical scroll bar. Unexpected behavior but if this holds true in more elaborate tests then at least I can code around it. On Nov 7, 2:06 pm, "Ian Bambury" <[EMAIL PROTECTED]> wrote: > I would guess that you missed a doctype - try > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" > "http://www.w3.org/TR/html4/loose.dtd"> > > I think that might change things, maybe not for the better. > > But the basic problem is what? > > Forget the 'how' for a moment. > > You want an HP with 2 cells, one 30% and one 70% and full height, is that > right? > > Borders? margins? > > Ian > > http://examples.roughian.com > > 2008/11/7 JohnMudd <[EMAIL PROTECTED]> > > > > > I've given up on the original problem, setCellWidth() with percents. > > I'm trying a new, hopefully simpler, direction but I have a new > > problem. > > > I'm now just trying to get by with setPixelSize(). Here's my new > > sample code. My first problem with the output is that I get a scroll > > bar on the right. The screen is a few pixels too tall. I made room > > for the borders. What did I miss? > > > John > > > 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(); > > > public void main() { > > int borderWidth = 30; > > int totalBorderWidth = borderWidth*2; > > int w, h; > > > root.add(basePanel); > > basePanel.setSize("100%", "100%"); > > basePanel.setBorderWidth(borderWidth); > > > basePanel.add(logPanel); > > w = (basePanel.getOffsetWidth()-totalBorderWidth)*30/100; > > h = basePanel.getOffsetHeight()-totalBorderWidth; > > logPanel.setPixelSize(w, h); > > logPanel.setBorderWidth(borderWidth); > > > basePanel.add(appPanel); > > w = (basePanel.getOffsetWidth()-totalBorderWidth)*70/100; > > h = basePanel.getOffsetHeight()-totalBorderWidth; > > appPanel.setPixelSize(w, h); > > appPanel.setBorderWidth(borderWidth); > > > log("root "+root.getOffsetWidth() + " "+root.getOffsetHeight()); > > log("basePanel "+basePanel.getOffsetWidth() + " > > "+basePanel.getOffsetHeight()); > > log("logPanel "+logPanel.getOffsetWidth() + " > > "+logPanel.getOffsetHeight()); > > log("appPanel "+appPanel.getOffsetWidth() + " > > "+appPanel.getOffsetHeight()); > > } > > > public static void log(String msg) { > > logPanel.add(new Label(msg)); > > } > > } > > > On Nov 6, 11:08 am, JohnMudd <[EMAIL PROTECTED]> wrote: > > > Thanks Ian. I'll work on it a bit first and then try to restate it. > > > > On Nov 5, 7:12 pm, "Ian Bambury" <[EMAIL PROTECTED]> wrote: > > > > > Hi John, > > > > Could you restate your problem as it is now. > > > > > Ian > > > > >http://examples.roughian.com > > > On Nov 5, 7:12 pm, "Ian Bambury" <[EMAIL PROTECTED]> wrote: > > > Hi John, > > > Could you restate your problem as it is now. > > > > Ian > > > >http://examples.roughian.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
