Info

This question is closed. Reopen it to edit or answer.

How do I resize some UICONTROLs in a GUI but not others?

3 views (last 30 days)
Devin
Devin on 31 Jan 2011
Closed: MATLAB Answer Bot on 20 Aug 2021
I have a gui that I need to view on screens of different sizes (13 inch laptop, 24-inch desktop). The gui is made up of a big graph with a title on the top and some data and control lists/radio buttons on the left hand side.
I've made my gui resizable but when I shrink it, the graph overlaps some things. How do I make it so the graph shrinks and nothing else??

Answers (2)

Doug Hull
Doug Hull on 31 Jan 2011
Basically, you are going to want to populate this callback with the code to do the resize based on the position (ie. size) of the figure window. You can do some calculations in this to take finer control over the size of the items on your GUI.

Jiro Doke
Jiro Doke on 31 Jan 2011
Doug's solution (using ResizeFcn) is the fundamental way of achieving your goal. There are a number of File Exchange submissions that help you with GUI layout. If you're not using GUIDE to create your GUI, you may be interested in some of them. The one that I like (one of the most extensive) is GUI Layout Toolbox.
I wrote a blog post about it here. From that post, you can access some of my other posts that highlight other GUI layout tools.

Tags

Community Treasure Hunt

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

Start Hunting!