- “Return Information to the Main App” on page 17-14 — Write a public function in the
main app that updates the UI based on the user's selections in the dialog box. Because
it is a public function, the dialog box can call it and pass values to it. - “Manage Windows When They Close” on page 17-15 — Write CloseRequest
callbacks in both apps that perform maintenance tasks when the windows close.
To see an implementation of all the steps in this process, see Plotting App That Opens a
Dialog Box on page 17-16.
Send Information to the Dialog Box
Perform these steps to pass values from the main app to the dialog box app.
(^1) In the dialog box app, define input arguments for the StartupFcn callback, and then
add code to the callback. Open the dialog box app into Code View. In the Editor tab,
click App Input Arguments. In the App Input Arguments dialog box, enter a
comma-separated list of variable names for your input arguments. Designate one of
the inputs as a variable that stores the main app object. Then click OK.
Add code to the StartupFcn callback to store the value of mainapp.
function StartupFcn(app,mainapp,sz,c)
% Store main app object
app.CallingApp = mainapp;
% Process sz and c inputs
...
end
Creating Multiwindow Apps in App Designer