This problem is not related to the GUI layout toolbox, but to the resizing of all Matlab figures. I've tried a lot of different tricks without success. Only on the Java level defining a minimum size is reliable:
FigH = gcf;
drawnow;
jFrame = get(handle(FigH), 'JavaFrame');
jProx = jFrame.fFigureClient.getWindow();
jProx.setMinimumSize(java.awt.Dimension(200,200));
The drawnow is required in R2009a, otherwise the limitation feature is active.
A nicer solution is to manage the resizing manually: Set 'Resize' to 'off', a user-defined resize function is triggered by the WindowsButtonDownFcn, when the cursor is less than 5 pixels from the window border. Check, if the mouse is on the left or right side of the figure. If the left side has been selected, the mouse motion is applied to the origin of the figure only until the distance to the right side is above the wanted limit.
Drawbacks: 1. The cursor is only caught inside the inner position of the figure. 2. The implementation is neither trivial nor lean. I assume you want to use the GUI layout toolbox to avoid writing a lot of special codes for standard tasks.
[EDITED] This works for 2009a and R2011b (I cannot test it under R2012b):
FigH = gcf; drawnow;
jFrame = get(handle(FigH), 'JavaFrame');
jWindow = jFrame.fHG1Client.getWindow;
jWindow.setMinimumSize(java.awt.Dimension(200,200));
- R2011b: The figure size is not reduced below the minimum size during mouse movement.
- R2009a: During resizing the minimum size is not considered. After the mouse is released, the window width and height is set accordingly. This moves the right window side, when you drag the left side below the limit.
Best Answer