Change or Add to greyed-out areas in App Designer

조회 수: 32 (최근 30일)
Mike D.
Mike D. 2020년 9월 6일
댓글: Mike D. 2020년 9월 8일
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?

채택된 답변

Mario Malic
Mario Malic 2020년 9월 6일
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.
  댓글 수: 1
Mike D.
Mike D. 2020년 9월 8일
Thanks. This seems to work. I can add UserData or appdata

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by