Did you try clientWidth: https://developer.mozilla.org/en/DOM/element.clientWidth
try: private native static int getClientHeight(Element elem) /*-{ return elem.clientHeight; }-*/; and private native static int getClientWidth(Element elem) /*-{ return elem.clientWidth; }-*/; See: http://code.google.com/p/gwt-mosaic/source/browse/trunk/src/org/gwt/mosaic/core/client/DOM.java Kind Regards, George. On Mar 10, 2:49 am, melody <mpedzi...@stuart.iit.edu> wrote: > I have struggled for quite some time with this. I have scoured the > Internet and the GWT group for possible answers but I have not seen > any. > > What I wanna know is how to determine the size of the view port > (viewable area) inside a ScrollPanel when the scrollbars are visible. > > For example: > > AbsolutePanel ap = new AbsolutePanel(); > ap.setPixelSize(1000, 1000); > > ScrollPanel sp = new ScrollPanel(ap); > sp.setPixelSize(100, 100).; > > When I try to retrieve the size of the scrollpanel sp using > sp.getOffsetWidth() and sp.getOffsetHeight() I get 100px for each when > what I want is really 100 less whatever the width or height of the > scrollbars is. > > What I want is the actual visible area that does not include the > height of the horizontal scrollbar or the with of the vertical > scrollbar. So if the scrollbar height (horz) was 20, the I want the > viewport height must be 100 - 20 = 80. > > The question again is how to determine the 20px. I just have not found > a way to do this. > > I am currently working with a magic number (based on nothing other > than what I thought might make sense) of 20Px for the horizontal > scrollbar height. > > Thanks, > > Melody --~--~---------~--~----~------------~-------~--~----~ 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-Toolkit@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 -~----------~----~----~----~------~----~------~--~---