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
-~----------~----~----~----~------~----~------~--~---