Change or Add to greyed-out areas in App Designer

30 Ansichten (letzte 30 Tage)
Mike D.
Mike D. am 6 Sep. 2020
Kommentiert: Mike D. am 8 Sep. 2020
In the Design View, when I add a UI control, such as a Tab Group, it auto adds code such as:
% Create TabGroup
app.TabGroup = uitabgroup(app.UIFigure);
app.TabGroup.Position = [13, 296, 540, 96];
% Create FirstTab
app.FirstTab = uitab(app.TabGroup);
app.FirstTab.Title = 'First';
I want to add another line to this greyed-out code, such as this:
app.FirstTab.UserData.ID = 5;
When I click on the Tab in design mode, it doesn't show all of the properties, such as "UserData". How do I add UserData to a Tab, when the code is greyed-out and won't let me change it?

Akzeptierte Antwort

Mario Malic
Mario Malic am 6 Sep. 2020
You do that by adding callback startupFcn which executes after component creation.
If you are on Editor tab, click on Callback and you'll see it on when you select UIFigure component.

Weitere Antworten (0)

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by