GWT - Retrieve size of a widget inside an AbsolutePanel
- by Garagos
I need to set the size of an absolutePanel regarding to its child size, but the getOffset* methods return 0 because (i think) the child as not been displayed yet.
A Quick example:
AbsolutePanel aPanel = new AbsolutePanel();
HTML text = new HTML(/*variable lenght text*/);
int xPosition = 20; // actually variable
aPanel.add(text, xPosition, 0);
aPanel.setSize(xPosition + text .getOffsetWidth() + "px", "50px"); // 20px 50px
Is there a way to:
retrieve the size of a widget that has not been displayed?
be notified when a widget is displayed ?