Re: Cannot set minimum size for NewtCanvasAWT
Posted by
Xerxes Rånby on
Jun 18, 2015; 10:05am
URL: https://forum.jogamp.org/Cannot-set-minimum-size-for-NewtCanvasAWT-tp4034732p4034735.html
If you set the size of your attached GLWindow then the NewtCanvasAWT
will use the same size as its minimum size.
http://jogamp.org/deployment/v2.3.1/javadoc/jogl/javadoc/com/jogamp/newt/opengl/GLWindow.html#setSize%28int,%20int%29
Den 2015-06-17 17:41, runiter [via
jogamp] skrev:
I noticed that no matter what value I put for minimum
size of NewtCanvasAWT, I keeps reverting back to current size.
After debugging I notices this is the reason why:
https://github.com/sgothel/jogl/blob/master/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java#L408
private final void updateLayoutSize() {
final Window w = newtChild;
if( null != w ) {
// use NEWT child's size for min/pref size!
final java.awt.Dimension minSize = new
java.awt.Dimension(w.getWidth(), w.getHeight());
setMinimumSize(minSize);
setPreferredSize(minSize);
}
}
Why is it necessary for NewtCanvasAWT to keep updating its own
size? Is this a bug?
If not then what is the proper way of setting the minimum size of
NewtCanvasAWT?