GUI elements locations has changed position

3 views (last 30 days)
TZ
TZ on 24 Jan 2018
Commented: Adam on 24 Jan 2018
Hi, I built a gui with numerous elements in it. When I loaded the program today, all the elements shifted upwords. As a result some of the elements are completely out of my reach and I can't even see them in order to put them back in their default position. I thought of changing each element position in the m file and them sort them back after I will see them in the GUI figure, but there must be a better way...

Accepted Answer

Adam
Adam on 24 Jan 2018
If you are using GUIDE there is an Object Browser in the View menu that allows you to gain access to every component, even if it is off the screen, then you can set its position from there. How it got in that state in the first place I don't know, but I have had to locate hidden components this way a few times.
  1 Comment
TZ
TZ on 24 Jan 2018
Yes!! this is what I was looking for, I thought the location parameters are to be found in the m file, but this is much more convenient since I can see the change in real time. thanks

Sign in to comment.

More Answers (1)

Rik
Rik on 24 Jan 2018
My solution is not to use GUIDE in the first place. It sets a lot of parameters for you, many of which don't preserve backwards compatibility. I always just use a blank figure to position each element and hardcode that position if I'm happy with it. Understanding how guidata, uicontrol and callbacks work isn't too hard, and it removes the extra layer of housekeeping.
  5 Comments
Rik
Rik on 24 Jan 2018
You know something is going wrong when you have to care about the precise pixel location of a button on a UI!
Which is why I don't. Barring the occasional exception, I will use normalized units. Sometimes Octave has the annoying tendency to not resize objects with normalized units, but I don't think this toolbox will fix that (nor does GUIDE btw).
Adam
Adam on 24 Jan 2018
Yeah, resizing of a GUI is always a nightmare and one of the main reasons I use the toolbox as it allows me to specify a combination of fixed pixel size and variable sizes for elements in a layout when resizing so that components which look stupid when resized too much can stay fixed and the other components will stretch to fill the new space. Whenever I can get away with it I like to do non-resizable GUIs, but that doesn't really work either due to different screen resolutions of our clients.

Sign in to comment.

Categories

Find more on Migrate GUIDE Apps 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!