Hello all! Well I'm attempting to change the position property of a GUI. I need to display different parts of a GUI at different times. So I have an example here showing two text boxes that show upper data and lower data, I need to resize the GUI to fit the lower data then fit the upper data. I know I can get the lower half easy, but the upper half is being a pain. Here is the example code:
% Make figure 1
f1 = figure('Name','Window 1'); %Add some text boxes
u1 = uicontrol(f1, ... 'Style','text', ... 'String','Upper Data', ... 'Callback','feval(plotf)', ... 'position', [250 380 100 15]); u1 = uicontrol(f1, ... 'Style','text', ... 'String','Lower Data', ... 'Callback','feval(plotf)', ... 'position', [250 20 100 15]); %grab current position data
get(gcf,'position') %so you see both the upper and lower regions
pause(2) %set new data
set(gcf,'position', [677 610 560 210])
What I need is to find a way to get essentially a position of:
set(gcf,'position', [677 610 560 210:420])
But that code is not the correct way to accomplish this. I need is a way to display the upper regions just like I display the lower regions.
Please help!
Thanks
Best Answer