how close external window in app designer?
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Vincenzo Bianco
el 1 de Mayo de 2019
Comentada: Stephane Dauvillier
el 2 de Mayo de 2019
I have two windows in app designer. "window1" create "window2".
I want to close all window with a button in window1. If i use "close all" or "close all force", it does not work.
2 comentarios
Walter Roberson
el 1 de Mayo de 2019
You mentioned external. Was the second window created by outside software such as Word or Fortnite?
Respuesta aceptada
Stephane Dauvillier
el 1 de Mayo de 2019
close instruction will only close figure
If you have created your windows1 (I suppose it's an app) like this
hWin1 = windows1 ;
Then you should be able to delete it with
delete(hWin1)
2 comentarios
Stephane Dauvillier
el 2 de Mayo de 2019
if hWin1 doesn't exist it will not work.
I suppose, you're not in the same workspace between the call of this
hWin1 = windows1 ;
And the call of this
delete(hWin1)
Otherwise, you wouldn't have this error message.
What you have to do is pass the variable hWin1
Without any other knowledge of your code it's pure guess.
So, what I'm guessing is your main app open other app. Then during this opening you have to assign the output of windows1 to a property of your main app.
By doing so, you will be able to delete this "sub app" when appropriate.
You can add properties in your main app named
mySubApps
In the initialization methods of your app you have to initialize this new property
function myInitiazeFunction(app)
app.mySubApps = [] ;
% put the rest of your initialization
end
Then In the methods where your main app open windows1
function myWhatever(app,someOtherParameter)
hWin1 = windows1 ;
app.mySubApps = [app.mySubApps;hwin1];
end
Do the same thing for every "sub app"
An then in the methodyou want your main app to close your sub app:
function deleteSubApps(app,someOtherParameters)
delete(app.mySubApps)
end
Más respuestas (0)
Ver también
Categorías
Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!