Filter löschen
Filter löschen

How to reproduce identical tab whenever button is clicked?

4 Ansichten (letzte 30 Tage)
Said Kemal
Said Kemal am 28 Mär. 2023
Kommentiert: AYBARS DOGAN am 23 Nov. 2023
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 Kommentar
chrisw23
chrisw23 am 28 Mär. 2023
...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.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Simon Chan
Simon Chan am 28 Mär. 2023
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

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Produkte


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by