GUI elements locations has changed position
3 views (last 30 days)
Show older comments
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...
0 Comments
Accepted Answer
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.
More Answers (1)
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
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
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.
See Also
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!