Question

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?

Was it helpful?

Solution

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);

OTHER TIPS

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;
}-*/; 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top