Hi all

Sorry to say expected behaviour entered wrong. It should be:

Actual output
        Before vp attached to RootPanel Offset width:0
        Before super.onAttach called Offset width:500
        After super.onAttach called Offset width:500
Expected output
        Before vp attached to RootPanel Offset width:0
        Before super.onAttach called Offset width:0
        After super.onAttach called Offset width:500


On Oct 5, 3:59 pm, Rick <[email protected]> wrote:
> Hi all
>
> I am making an application using GWT 1.7. But I am surprised by the
> behaviour I got. I took a vertical panel and add a button on this. I
> set width of button to 500px. Now What I was expected that in onAttach
> () of Vertical panel, before calling super.onAttach(), the offsetWidth
> of vertical panel should be zero. But it is giving me 500px.
>
> VerticalPanel vp = new VerticalPanel() {
> @Override
> protected void onAttach() {
>                 GWT.log("Before super.onAttach called Offset width: " +
> getOffsetWidth(), null);
>                 super.onAttach();
>                 GWT.log(After super.onAttach called Offset width: " + 
> getOffsetWidth
> (), null);
>         }};
>
> Button b = new Button("Hello");
> b.setWidth("500px");
> vp.add(b);
> GWT.log("Before vp attached to RootPanel Offset width: " +
> vp.getOffsetWidth(), null);
> RootPanel.get().add(vp);
>
> Actual output
>         Before vp attached to RootPanel Offset width:0
>         Before super.onAttach called Offset width:500
>         After super.onAttach called Offset width:500
> Expected output
>         Before vp attached to RootPanel Offset width:0
>         Before super.onAttach called Offset width:500
>         After super.onAttach called Offset width:500
>
> Thanks and regards
>
> Rick
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to