How to reproduce identical tab whenever button is clicked?

조회 수: 6 (최근 30일)
Said Kemal
Said Kemal 2023년 3월 28일
댓글: AYBARS DOGAN 2023년 11월 23일
I have created an app using AppDesigner Tool. I want to reproduce the tab shown in following figure in identical configuration whenever button is clicked. How can I achive this?
  댓글 수: 1
chrisw23
chrisw23 2023년 3월 28일
...one of x possibilities
Store each uiControl state on button click in private properties (structure of your choice) and compare with current settings on next click. Define your initial tab setting in the startup function.

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

채택된 답변

Simon Chan
Simon Chan 2023년 3월 28일
Set the Callback of Button pushed function as follows:
% Button pushed function: Button
function duplicateTab(app, event)
obj = allchild(app.Tab); % Find all childrens from the 1st tab
newtab = uitab(app.TabGroup,'Title',app.Tab.Title); % Create a new tab with the same title
copyobj(obj,newtab); % Copy all objects to the new tab
end

추가 답변 (0개)

카테고리

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

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by