GUI resize functionality and screen resolution

4 views (last 30 days)
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 Comment
Jagdish Vajravelu
Jagdish Vajravelu on 4 Feb 2015
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'

Sign in to comment.

Answers (1)

per isakson
per isakson on 4 Jan 2014
Edited: per isakson on 4 Jan 2014
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

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!