Robert Silver
asked on
How to properly obtain screen dimensions in GWT?
How do I properly obtain screen dimensions for the RootPanel of the browser screen?
Would using say:
com.google.gwt.user.client .ui.HTML
and calling:
e.g
HTML htmlObj;
int myHeight= htmlObj..getOffsetHeight() ;
int myWidth=htmlObj.getOffsetW idh();
I would appreciate any help here ???
Would using say:
com.google.gwt.user.client
and calling:
e.g
HTML htmlObj;
int myHeight= htmlObj..getOffsetHeight()
int myWidth=htmlObj.getOffsetW
I would appreciate any help here ???
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Well I found out something else everyone here should know. Microsoft Internet Explorer does not work well with Absolute positioning within GWT. Please let me know if you find a way to use Absolute positioning. I ultimately set Absolute positioning with the statement:
rootPanel.getElement().get Style().se tPosition( Position.A BSOLUTE);
Then get the the Offsets e.g
getOffsetHeight() and getOffSetWidth() and they both return proper values to be used,however, I must set rootPanel.getElement().get Style().se tPosition( Position.R ELATIVE);
and then provide relative positioning to solve the cross browser needs.
Note GWT is no longer supported by Firefox 14 latest addition at the time of this writing nor is it supported by Opera or Safari. Only IE and Google Chrome and the Chrome is a pain to install GWT now. drag and drop nonsense has to be done in a prescribed maner due to some ill conceived security constraints.
Just updating my previous solution.
rootPanel.getElement().get
Then get the the Offsets e.g
getOffsetHeight() and getOffSetWidth() and they both return proper values to be used,however, I must set rootPanel.getElement().get
and then provide relative positioning to solve the cross browser needs.
Note GWT is no longer supported by Firefox 14 latest addition at the time of this writing nor is it supported by Opera or Safari. Only IE and Google Chrome and the Chrome is a pain to install GWT now. drag and drop nonsense has to be done in a prescribed maner due to some ill conceived security constraints.
Just updating my previous solution.
ASKER
e.g rootPanel.getOffsetHeight(
e.g if I rootPanel.setSize("100%","
By default I would have thought the default getOffsetHeight() would be the physical size possible of a graphic on a given screen e.g Android might be 400px by 640px maybe and
I could then get those values. How might I get the physical for device height in pixels then?