Hi Litty,
I use something like this:
public class MdDem implements EntryPoint {
private MainPage main = new MainPage();
private ResizeListener windowListener = new ResizeListener();
public void onModuleLoad() {
RootPanel.get().add(main);
Window.addWindowResizeListener(windowListener);
// initial sizing call if you need it
windowListener.onWindowResized(Window.getClientWidth(),
Window.getClientHeight());
}
// window resize listener
private class ResizeListener implements WindowResizeListener {
private int width, height;
private boolean pending;
private Command command;
ResizeListener() {
command = new Command() {
public void execute() {
pending = false;
main.adjustSize(width, height);
}
};
}
public void onWindowResized(int width, int height) {
this.width = width;
this.height = height;
if (pending == false) {
pending = true;
DeferredCommand.addCommand(command);
}
}
}
}
regards
gregor
On Dec 3, 7:33 am, "alex.d" <[EMAIL PROTECTED]> wrote:
> Basically you have to listen to browser "change size" events (not sure
> how reliable this is in all supported browsers) and forward new size
> to your widgets. Ext GWT (and probably GWT Ext) for example, already
> has ViewPort implementation.
>
> On 3 Dez., 05:11, Litty Preeth <[EMAIL PROTECTED]> wrote:
>
> > Hi friends,
>
> > Anybody has any ideas on this?
>
> > Thanks and Regards,
> > Litty Preeth
>
> > On Dec 2, 4:42 pm, "Litty Preeth" <[EMAIL PROTECTED]> wrote:
>
> > > Hi All,
>
> > > Anybody know how to implement a viewport resize listener? Basically I
> > > have a
> > > glass panel (light box effect). I want to notify this glass panel whenever
> > > my RootPanel size gets changed so that I can resize my glass panel to
> > > fillup
> > > the area.
>
> > > Regards,
> > > Litty Preeth
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---