Login  Register

Cannot set minimum size for NewtCanvasAWT

Posted by runiter on Jun 17, 2015; 3:41pm
URL: https://forum.jogamp.org/Cannot-set-minimum-size-for-NewtCanvasAWT-tp4034732.html

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