GUI elements locations has changed position
6 ビュー (過去 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...
0 件のコメント
採用された回答
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 件)
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
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
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 Center および File Exchange で Migrate GUIDE Apps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!