Increasing the figure size in GUI

조회 수: 1 (최근 30일)
Chris Dan
Chris Dan 2021년 1월 26일
답변: Geoff Hayes 2021년 1월 26일
Hello
I have this gui which is static in size, as shown in pictures
I use the following code to create this figure
function EVRIM_GUI
clear 'all'
f = figure('Visible','off','Units', 'centimeters', 'Position',[0.25,0.75,35.5,16.5]);
AddBody = uicontrol('Style','pushbutton','String','AddBody','Units', 'centimeters','Position',[21.5,15,3,1],'Callback',{@AddBody_Callback});
DrawBodys = uicontrol('Style','pushbutton','String','DrawBody','Units', 'centimeters','Position',[24.5,15,3,1],'Callback',{@DrawBodys_Callback});
ElementMatrices = uicontrol('Style','pushbutton','String','Create Matrices for each Element','Units', 'centimeters','Position',[21.5,14,6,1],'Callback',{@ElementMatrices_Callback});
GlobalMatrices = uicontrol('Style','pushbutton','String','Global Matrix Rigid Without Boundary','Units', 'centimeters','Position',[21.5,11,6,1],'Callback',{@GlobalMatrices_Callback});
CreateMesh = uicontrol('Style','pushbutton','String','CreateMesh','Units', 'centimeters','Position',[27.5,11,3,1],'Callback',{@CreateMesh_Callback});
ClearAll = uicontrol('Style','pushbutton','String','ClearAll','Units', 'centimeters','Position',[21.5,10,3,1],'Callback',{@ClearAll_Callback});
ImportData = uicontrol('Style','pushbutton','String','Import Previous BodyData','Units', 'centimeters','Position',[21.5,7,4,1],'Callback',{@ImportData_Callback});
I didnot write the complete code, because for buttons it is mostly similar.
Now when I go full scree on the gui, the gui increases in size but the position of buttons and the grid size remains the same. As shown:
I want to change it, so when I go full screen, the buttons go on the side and the grid display increases in size. The table belows also change their size
Does anybody knows how to do it?

답변 (1개)

Geoff Hayes
Geoff Hayes 2021년 1월 26일
hamzah - try using normalized units instead. See figure units for details.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by