matlabmatlab-guide

Unable to change GUI size in MATLAB's GUIDE interface


For some reason I am unable to resize the workspace size of a GUI figure using MATLAB's built in GUIDE editor. Every time I do so (by dragging the corner of the workspace), I get a warning in MATLAB's console stating:

Warning: Cannot set Position while WindowStyle is 'docked' 
> In guidefunc>resizeFigure at 2693
  In guidefunc at 116 

I have tried setting the default window style to 'normal' (set(0,'DefaultFigureWindowStyle','normal')) to no avail.

I see no reports of this strange behaviour elsewhere online, and wonder if anyone else has experienced this?

Am using MATLAB R2012a. Any thoughts appreciated(!)


Solution

  • Default-Window-Style and Window-Style are two different things. If you want to change the WindowStyle, you should use that property. In addition take care for the handle of the figure!

    %get handle:
    myFigure= findobj('Tag','SomeUniqueTagHere') %make sure to get the right one
    set(myFigure,'WindowStyle','normal')
    

    I guess (but I'm not absolutely sure) default-properties will just be used during creation.