Maybe you haven't added your tab panel to the root panel. I think getOffsetWidth and height return 0 while the widget isn't attached. There's not much you can do about that but I'd be delighted to be proven wrong.
Cheers, Salvador On 13 mai, 04:57, Ewald Pankratz <[email protected]> wrote: > Hi all > I wounder why x and y are zero. Is this a bug? Maybe I do not > understand the meaning behind. > > thanks. > > public class MyTabPanel extends TabPanel { > > int x, y; > > public MyTabPanel() { > > super(); > > setStyleName("TAB_PANEL"); > setSize("100%", "100%"); > > add(new HTML("here is the first tab"), "TAB1"); > add(new HTML("here is the second tab"), "TAB2"); > add(new HTML("third tab"), "TAB3"); > > selectTab(0); > > x = getAbsoluteLeft() + getOffsetWidth(); > y = getAbsoluteTop() + getOffsetHeight(); > > GWT.log("- X=[" + x + "] y=[" + y + "]", null); > > x = getTabBar().getAbsoluteLeft() + getTabBar > ().getOffsetWidth(); > y = getTabBar().getAbsoluteTop() + getTabBar > ().getOffsetHeight(); > > GWT.log("- X=[" + x + "] y=[" + y + "]", null); > } > > } > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
