check if mainAPP exist in app designer

hi, i read this guide :
i want to know if Main App has been launched.. otherwise I launch it from here

댓글 수: 5

chrisw23
chrisw23 2023년 6월 20일
편집: chrisw23 2023년 6월 20일
Typically the main app starts a child app and hold its app instance. If the main app will be closed the child app should be closed too by the close callback.
properties (Access = private)
childApp % declare private property
end
...
app.childApp = ChildApp(<arg>) % start child app somewhere
...
function CloseRequest(app)
app.childApp.delete % close the child app first
app.delete % close the main app
end
piero
piero 2023년 6월 20일
편집: piero 2023년 6월 20일
Yes, that's correct, but I didn't ask it
I want to know from within childApp if the main exists (because when I develop the child app I can't always run the main to test the child it takes longer)
chrisw23
chrisw23 2023년 6월 20일
Sry, but you mentioned that you have to start your main anyway. If it's not yet open "... otherwise I launch it from here"
chrisw23
chrisw23 2023년 6월 20일
Since Matlab R2020 you have the option to set the 'Single Running Instance' flag. Maybe this is a workaround for your problem.
"When Single Running Instance is selected and you run the app multiple times, MATLAB reuses the existing instance and brings it to the front rather than creating a new one. When this option is cleared, MATLAB creates a new app instance each time you run it and continues to run the existing instances. These run behaviors apply to apps that you run from the Apps tab on the MATLAB Toolstrip or from the Command Window.
When you run apps from App Designer their behavior doesn't change whether this option is selected or cleared. App Designer always closes the existing app instance before creating a new one."
piero
piero 2023년 6월 20일
thanks

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

답변 (1개)

Walter Roberson
Walter Roberson 2023년 6월 20일

1 개 추천

No. MATLAB does not offer any any general mechanism to test whether variables of particular classes exist.

댓글 수: 1

piero
piero 2023년 6월 20일
i created 2 tables in app designer The MAIN table A and the child table B inheriting data from A via input into the function
Question: when I develop table B as there are variables passed as a parameter of A how do I do the various tests on B without launching A? the development phase of B becomes very difficult that I have to launch table A all the time

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

카테고리

도움말 센터File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

질문:

2023년 6월 18일

댓글:

2023년 6월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by