I think there are two ways to do that.
1.) Call forceLayout() on your LayoutContainer. This will call onResize on
all client widgets which implement the RequireResize interface.
In the onResize method of your canvas widget you can retrieve the available
width by calling getParent().getOffsetWidth() (instead of getParent() you
can call it on a container panel etc)
2.) When the canvas widget gets constructed you can issue a deferred command
and set the size in it:
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
canvasWidget.onResize();
}
});
--
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/-/zHoHAWlk9U8J.
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.