필터 지우기
필터 지우기

GUI resize functionality and screen resolution

조회 수: 4 (최근 30일)
Lorenzo
Lorenzo 2014년 1월 3일
댓글: Jagdish Vajravelu 2015년 2월 4일
Dear all, I discovered that my GUI changes a lot when changing the display resolution and the result is that some of the elements are not aligned anymore and the whole thing looks really messed up.
Now, I read a lot on the internet about this problem and I manage to find some solutions but the final result is still not perfect.
I set the GUI resize behaviour to be proportional and the units of all my elements to normalized.
Now, one problem is that, this way, the text does not get scaled along with the other elements, meaning that the single lines get broken in two or three. I cannot change the units of the text since when changing them to normalized they get back to pixel right away. Would it be possible to reduce the fonts in order to keep what is originally on one line still on one line only?
When resizing the GUI, I end up either with a lot of space around my elements (if one resizes the GUI to be too big) or with the elements to be too shrinked down to be used (if one resizes the GUI to be too small). To this extent, would it be possible to set limits to the GUI min and max dimensions?
Final question: instead of resizing the elements along with the GUI, would it be possible to leave them exactly as I see them on my computer and to change the gui dimensions by adding scrollbars in order to be able to reach all of them? (At the moment if their units are not set to normalized it may happen that some of the elements are hidden down and there's no way to resize the window and to show them)
Thanks!
  댓글 수: 1
Jagdish Vajravelu
Jagdish Vajravelu 2015년 2월 4일
Hi. Sorry for pretty late comment. I just created my community profile. I am using R2012a. This is possible by right clicking anywhere in the GUI-->GUI options and changing the 'Resize behavior' to 'Proportional'

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

답변 (1개)

per isakson
per isakson 2014년 1월 4일
편집: per isakson 2014년 1월 4일
Some comments:
  • "final result is still not perfect" but maybe it is good enough? A "perfect" GUI is hardly possible with Matlab.
  • There are a handfull of GUI layout managers in the file exchange. That tells me that Matlab asks for improvements regarding GUI-building
  • A better result can be achieved with pixels (rather than normalized) in combination with handle graphic low level code. However, that is a lot of work.
  • Use set(ui_control_handle,'FontSize',n) to change the size of the text

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by