Maximize my GUI window

조회 수: 52 (최근 30일)
Hassan Bosha
Hassan Bosha 2019년 3월 27일
댓글: Adam Danz 2024년 6월 5일
How can i maximize my GUI window keeping the ratio of all my labels and buttons maximized with the window
  댓글 수: 1
Adam
Adam 2019년 3월 27일
I use the GUI Layout toolbox to put all my components in layouts and have them resize nicely. It's more work, but I find it way better than alternatives. Resizing GUIs is always a big problem as they usually look awful when maximised, whether the components resize or not, unfortunately. Neither of these methods will scale text size though. There is a setting to do that, though I can't remember it off-hand. I seem to remember it is a bit suspicious though and resized my text differently in different places that just looked stupid.

댓글을 달려면 로그인하십시오.

채택된 답변

Adam Danz
Adam Danz 2019년 3월 27일
편집: Adam Danz 2024년 6월 5일
If your GUI was created in GUIDE(),
  1. open your gui in guide: guide('mygui')
  2. Select tools > GUI Options...
  3. In the "Resize behavior" dropdown box, select 'Proportional'
  4. Save, close
  5. If your GUI is already opened, close it; run your GUI
If your GUI was created programmatically using UICONTROL(),
  1. Set the units of all GUI components to 'normalized (see below)
% h is the handle to the figure hosting your gui
set(findall(h, '-property', 'Units' ), 'Units', 'Normalized' )
If your GUI was created in APP DESIGNER
  1. open your gui in app designer: appdesigner('mygui')
  2. From the component browser on the right, select the main figure (probably on top of the list)
  3. In the properties window below, select 'Resize' (prior to R2018b, select 'Resize components when app is resized').
  4. Save the app; close.
  5. If your GUI is already opened, close it; run your GUI
Now you can maximize the figure and the components should scale to the new figure size.
  댓글 수: 2
Bogdan -Ervin
Bogdan -Ervin 2024년 6월 5일
My GUI is created in App Designer of MatlabR2023b, and I do not find any UI Figure Properties, much less a resize option..
Adam Danz
Adam Danz 2024년 6월 5일
Those instructions were written based on MATLAB R2018a. The names changed in R2018b. I've updated my answer. Thanks for reporting.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by