Increasing the figure size in GUI

12 ビュー (過去 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 Center および File ExchangeInteractive Control and Callbacks についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by