Programmatically resize browser window in GWT -
I'm developing the GWT app, I have to change the height of the browser window programmatically. Is there a way to do this in GWT? I have tried the following:
Public Fixed Country Zero Set WindowHighth (final integer height) / * - {$ wnd.resizeTo ($ wnd.outerWidth, height); } - * /;
But this not only changes the height, it also messes with the width. Besides, I have the functionality of this size within the GWT Java code (it uses JSNI) Would like to keep
EDIT: This does not actually interfere with the width of most browsers - this is the last width and new height. This makes my Google hosted mode browser width due to some reason.
I really like something that changes the browser area of the browser (i.e. except for the browser toolbar and scrollbar etc). ) Instead of the window.
For example, the following methods are com.google.gwt.user.client.Window: getClientWidth () and getClientHeight () I have to do something that sets client width (int width) and set client Height (int height) will be equal to (keep in mind that these sets do not actually exist).
As far as I know, you have to use JSN for such things. Window.scrollTo (...) is another way that comes in handy which is not available through the GWT window.
What you can do though, write your own extended window which extends to the GWT window. For example:
public class expanded window window {public static origin to change zero size (last full width, final integer height) / * - {$ wnd.resizeTo (width, height) ; } - * /; Public Static Basic Zero Scrolls (Last favored xpos, final gut ypos) / * - {$ wnd.scrollTo (xpos, ypos); } - * /; // ... etc ...
Then you use ExtendedWindow
when you need these extended behaviors.
I do not believe setClientHeight ()
is going to be available, because it is not available via JavaScript. But I'm sure you calculate clientHeight
with the difference between outerHyight
for the first time by using resizeTo (...)
, And then when you change clientHeight
, keep the difference.
I hope this is useful.
Comments
Post a Comment