Re: Setting proper window size with NEWT
Posted by
Sven Gothel on
Aug 20, 2012; 3:13am
URL: https://forum.jogamp.org/Setting-proper-window-size-with-NEWT-tp4025780p4025839.html
On 08/19/2012 08:51 PM, zeeawk [via jogamp] wrote:
> Sorry for the late reply. Unfortunately that doesn't work quite right.
>
> SystemTray.getSystemTray().getTrayIconSize.getHeight() returns the size of the
> icons in the System Tray.
>
> The height (at least on my machine) of System tray icons is 16 which is not
> the right size of the Task bar which is 40 (on my machine).
>
> Having a newt method to return the size of that task bar would be ideal or
> perhaps a newt equivalent to this:
>
> java.awt.Rectangle windowSize =
> java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
>
> java.awt.Dimension screenSize =
> java.awt.Toolkit.getDefaultToolkit().getScreenSize();
> final int taskBarHeight = screenSize.height - windowSize.height;
so you like to 'maximize the window',
lets discuss the following 2 approaches:
EITHER ..
+++
Dimension size = xxx.getMaximumWindowSize();
or
Rectangle bounds = xxx.getMaximumWindowBounds()
where xxx could be the NEWT screen or similar,
however .. implementation querying the windowmanager for this information.
If anybody here know the implementation of this for: X11, Windows, OSX, ..
pls send reference and/or code snippets.
+++
OR ..
+++
BTW .. this is similar to another RFE
window.setMaximize(boolean)
boolean window.isMaximized()
+++
The latter IMHO would be cheaper to implement.
Maybe both are required .. dunno.
~Sven