i think my need for this was largely obsoleted by the R2020b+ feature of CompontentContainer, which manages for you the constructor/setup syntax and input parsing.
How to identify ui component classes that other ui components can be children of
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
J. Alex Lee
am 4 Mai 2020
Kommentiert: J. Alex Lee
am 22 Apr. 2021
I am trying to identify ui components like uipanels, uigridlayouts, uitabs, etc., that may contain other ui components as children.
Right now I'm just testing if the class name contains "matlab.ui.container" or is a figure:
contains(class(o),'matlab.ui.container') || isa(o,'matlab.ui.Figure') ...
Is there a better way?
Akzeptierte Antwort
Monika Phadnis
am 12 Mai 2020
You can also use the 'Children' property of UI components.
This property contains list of child component objects if any, it is empty otherwise.
For example, you can refer to this documentation for 'uifigure' properties and 'uipanel' properties :
- https://in.mathworks.com/help/matlab/ref/matlab.ui.figureappd-properties.html#bu4i700-1-Children
- https://in.mathworks.com/help/matlab/ref/matlab.ui.container.panelappd-properties.html#bub8wap-1-Children
You can check if this property is empty or has some components under it.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!