Why are panels/buttons missing in GUIDE but visible in the GUI?
10 views (last 30 days)
Show older comments
Stefan Weiher
on 13 Jan 2016
Edited: thomassimm
on 31 Jul 2017
I got a source code for a GUI that is used with matlab version 2013b. Now, I am supposed to do some changes to this GUI and to use it with version 2015a. I also have the same problems as have been reported (and solved) earlier: panels hiding text fields and buttons (see e. g. the "Gun" panel in the attached screenshot). I know how to solve this.
But there is another problem that I haven't found any reference to/solution for: When I run my GUI from within GUIDE I see panels and buttons (marked by red rectangles) that are not visible in GUIDE. I ran the "matlab graphics finder" app and it tells me that many text fields and buttons are hidden behind the "Gun" panel but if I don't even see the panels in GUIDE I cannot switch the layers, that is, send panel to back, etc. Also, when I use the object browser in GUIDE I don't see these panels and buttons but they are created when I run the figure, so, these objects should be there. But, in GUIDE, they are not.
Can anybody tell me what is going on here? Help is greatly appreciated.
1 Comment
thomassimm
on 31 Jul 2017
Edited: thomassimm
on 31 Jul 2017
I have a similar problem, whenever I open guide on a GUI containing multiple panels, many of the components within the panels disappear (left). If I send the panel to the back and then to the front, then move the panel they become visible again but often they have been moved and resized (right). As shown in middle they are ok when the GUI is run. An absolute pain, would love to know how to avoid this. Am using Matlab 2015a. Thomas
Accepted Answer
Walter Roberson
on 13 Jan 2016
GUIDE only shows graphics objects that are created through GUIDE. Graphics objects that are created on-the-fly will not show up. Look through the code for places where uicontrol() is called: any call to uicontrol is probably creating a new graphics object.
(The only case where uicontrol does not create a new graphics object is if you pass uicontrol() the handle to an existing uicontrol, and nothing else: that particular syntax means that the given uicontrol is to be given the focus.)
3 Comments
Walter Roberson
on 14 Jan 2016
The parent property does play a role. However up to R2014a, uicontrol always appeared on top even if other objects were created over top of them. Starting in R2014b, the real layering is paid attention to. GUIDE was not good about getting the layering right before.
More Answers (0)
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!