필터 지우기
필터 지우기

How do I delete some tabs in a tab group in AppDesigner programatically?

조회 수: 36 (최근 30일)
Partha Mitra
Partha Mitra 2020년 3월 1일
댓글: Will Reeves 2022년 8월 19일
How do I delete some tabs in a tab group in AppDesigner programatically?
Steps I am currently doing:
1. I am plotting a bar by a push button.
2. Expectation: When I am re-pushing the push button I want the old tabs to be deleted and new ones to come up.
Current: When I am re-pushing the push button, the old tabs are staying and fresh set of new tabs are opening.

답변 (1개)

Abhishek Chakram
Abhishek Chakram 2022년 6월 27일
Hi Partha Mitra,
You can use the delete method to remove the old tabs and plot the new bar in a fresh tab.
  댓글 수: 2
Will Reeves
Will Reeves 2022년 8월 19일
편집: Will Reeves 2022년 8월 19일
Hi, can you give an example of this please?
This does not work:
If you use this method to create the tabs in the first place:
I'm probably missing something, so an example would be great.
Specifically, if you create an "app property" to hold handles to UI elements, how do you "delete" them? "clearing" or setting to empty does not remove the element obviously.
For instance:
properties (Access = private)
tabs % structure to hold the tabs for different datasets
end
and creating like this:
app.tabs=cell(1,length(dataSets));
then:
for i=1:length(dataSets)
app.tabs{i}= uitab(app.TabGroup,"Title",['Measurement ' num2str(i)]);
end
Will Reeves
Will Reeves 2022년 8월 19일
Actually... is it just OK to "copy" the handle to a local variable and delete it? It seems to work, but is it "clean"?
for i=1:length(app.tabs)
a=app.tabs{i};
delete(a);
end
for instance?

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

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

태그

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by