Reputation: 7380
I have an gwt-ext window (used as a popup), this popup is launched from a GWT application. I´m searching for a solution to set the window-size of the popup to a size, that it nearly fills the screen, not maximize, but to fill the area of an underlying part of the GWT application that launched this popup. Does anybody know a solution for that problem?
Upvotes: 0
Views: 4336
Reputation: 3717
This will size to the screen size (not the current browser size)
yourExtGwtWindow.setHeight(screenHeight());
yourExtGwtWindow.setWidth(screenWidth());
...
public static native int screenWidth()
/*-{
return screen.availWidth;
}-*/;
public static native int screenHeight()
/*-{
return screen.availHeight;
}-*/;
Upvotes: 1
Reputation: 5279
Try something like this:
int windowHeight=Window.getClientHeight()-10; //I subtract 10 from the client height so the window isn't maximized.
int windowWidth=Window.getClientWidth()-10; //I subtract 10 from the client width so the window isn't maximized.
yourExtGwtWindow.setHeight(windowHeight);
yourExtGwtWindow.setWidth(windowWidth);
Upvotes: 3