GUI elements locations has changed position
Ältere Kommentare anzeigen
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...
Akzeptierte Antwort
Weitere Antworten (1)
Rik
am 24 Jan. 2018
1 Stimme
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 Kommentare
TZ
am 24 Jan. 2018
Stephen23
am 24 Jan. 2018
+1 Writing your own means you can control everything yourself.
Adam
am 24 Jan. 2018
And if you want slightly less insanity you can use the GUI Layout Toolbox on the File Exchange which I always use for programmatic UIs which allows you to design a bunch of layouts that resize decently and position elements nicely for you without you having to care about exact positions too. You know something is going wrong when you have to care about the precise pixel location of a button on a UI!
Rik
am 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
am 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.
Kategorien
Mehr zu Migrate GUIDE Apps finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!