Reputation: 5690
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(!)
Upvotes: 1
Views: 1307
Reputation: 3472
Improving upon Lucius' answer, I was able to resize the figure after using the following command on the workspace window.
set(gcf,'WindowStyle','normal')
This command helps sets the window style to normal and hence is resize-able.
I am using Matlab R2020b and the figure under question was selected (highlighted) before I ran this command.
Upvotes: 1
Reputation: 1832
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.
Upvotes: 0
Reputation: 184
You can resize the workspace in GUI and therefore avoid the error message
Warning: Cannot set Position while WindowStyle is 'docked'
by changing the setting WindowStyle
in the GUI. To the end you should:
WindowStyle
and change it from docked
to normal
.After that you can resize your workspace normally.
Upvotes: 0