I have now thank you. Yes it gives me the height of the window.

What I want to do is size a canvas so it fills the window. However the
canvas is inside the document body so has the body's borders around
it. That is why I am using body.getClientWidth() which gives the width
inside the borders. To use Window.getClientHeight, I need to subtract
the border height before using the value to size my canvas. I can't
find any way to get the border. body.get{Absolute,Offset}{Left,Top}
all return 0 as does body.getOffsetHeight. body.getOffsetWidth returns
the same value as body.getClientWidth. (In all cases body =
RootPanel.getBodyElement()).

Any suggestions for getting the border height?

    -Mark


On Nov 6, 6:45 am, Craig <yavinm...@gmail.com> wrote:
> Have you tried Window.getClientHeight()?
>
> On Nov 5, 3:21 am, magic <callow_m...@hicorp.co.jp> wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > I am looking for a way to query the size of the browser's document
> > window when onModuleLoad is called. I have tried
>
> > Element body = RootPanel.getBodyElement();
> > int clientWidth = body.getClientWidth();
> > int clientHeight = body.getClientHeight();
>
> > body.getClientWidth() gives the correct width, but
> > body.getClientHeight always returns 0. In fact all queries on body
> > having to do with height return 0.
>
> > I had similar problems in pure javascript with
>
> > dw = document.body.offsetWidth;
> > dh = document.body.offsetHeight;
>
> > I overcame it there with the following:
>
> >   // IE does not appear to support window.innerHeight.
> >   if (typeof(window.innerHeight) == 'number')
> >         dh = window.innerHeight;
> >   else if (document.documentElement &&
> > document.documentElement.clientHeight)
> >         dh = document.documentElement.clientHeight;
> >   else if (document.body & document.body.clientHeight)
> >         dh = document.body.clientHeight;
>
> > Anyway to do something similar via GWT?
>
> >     -Mark

-- 
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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to