MATLAB Creating Graphical User Interfaces

(ff) #1

Creating Multiwindow Apps in App Designer


A multiwindow app consists of two or more apps that share data. The way that you share
data between the apps depends on the design. One common design involves two apps: a
main app and a dialog box. Typically, the main app has a button that opens the dialog box.
When the user closes the dialog box, the dialog box sends the user's selections to the
main window, which performs calculations and updates the UI.

These apps share information in different ways at different times:


  • When the dialog box opens, the main app passes information to the dialog box by
    calling the dialog box app with input arguments.

  • When the user clicks the OK button in the dialog box, the dialog box returns
    information to the main app by calling a public function in the main app with input
    arguments.


Overview of the Process


To create the app described in the preceding section, you must create two separate apps
(a main app and a dialog box app). Then perform these high-level tasks. Each task
involves multiple steps.


  • “Send Information to the Dialog Box” on page 17-13 — Write a StartupFcn callback
    in the dialog box app that accepts input arguments. One of the input arguments must
    be the main app object. Then, in the main app, call the dialog box app with the input
    arguments.


17 App Programming

Free download pdf