I have a PopupPanel with a Label inside. I'm trying to center the popup 
horizontally, so I'm calling setPopupPositionAndShow. In the callback, 
however, the offsetWidth and offsetHeight arguments don't take into account 
any margins or padding, whether I set them on the popup or the label: the 
values are always for the text of the label only. Besides the arguments to 
the callback, I get the same (incorrect) results from calling 
getOffsetWidth/Height on the label or the popup directly. 
PopupPanel#center() also does not work correctly. Tested on both Chrome and 
Firefox.

Here's the code I'm using to set the position:
    messageLabel.setText(message);
    popup.setPopupPositionAndShow(new PositionCallback() {
      @Override
      public void setPosition(int offsetWidth, int offsetHeight) {
        popup.setPopupPosition((Window.getClientWidth() - offsetWidth) / 2, 
popupTop);
      }
    });

The PopupPanel is in a UiBinder; not sure if that's relevant. Am I doing 
something wrong, or should I file a bug?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/OrHBZ_YgufcJ.
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.

Reply via email to