I noticed that no matter what value I put for minimum size of NewtCanvasAWT, it 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?
Saeid Nourian, Ph.D. Eng. | Graphing Calculator 3D
|
Administrator
|
Actually, there is no notion of minimum size in NEWT as far as I know, maybe Sven can confirm.
Julien Gouesse | Personal blog | Website
|
In reply to this post by runiter
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: |
In reply to this post by gouessej
As a workaround I can force the minimum size by keep resetting it in the resize event function. And it works so I know NEWT is capable of it. But the workaround is ugly so someone just needs to delete the calls to setMinimumSize() in that updateLayoutSize() method and I think it will work nicely. I tried the following but it didn't work. Looks like GLWindow size keeps getting recalculated. canvas.getNEWTChild().setSize(100, 100);
Saeid Nourian, Ph.D. Eng. | Graphing Calculator 3D
|
Free forum by Nabble | Edit this page |