GUI elements locations has changed position

3 次查看(过去 30 天)
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...

采纳的回答

Adam
Adam 2018-1-24
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 个评论
TZ
TZ 2018-1-24
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

请先登录,再进行评论。

更多回答(1 个)

Rik
Rik 2018-1-24
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 个评论
Rik
Rik 2018-1-24
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 2018-1-24
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by