1 | <html xmlns:saxon="http://icl.com/saxon"> |
---|
2 | <head> |
---|
3 | <link rel="stylesheet" type="text/css" href="doc.css"/> |
---|
4 | <link rel="stylesheet" type="text/css" href=""/> |
---|
5 | <meta author="The MathWorks Ltd."/> |
---|
6 | <meta copyright="2011 The MathWorks Ltd."/> |
---|
7 | <title>Running it</title> |
---|
8 | </head> |
---|
9 | |
---|
10 | |
---|
11 | <body> |
---|
12 | <table class="header" width="100%" border="0" cellspacing="0" cellpadding="0"> |
---|
13 | <tr> |
---|
14 | <td bgcolor="#e4f0f8"><A href="User guide.html"><font face="Arial" bgcolor="#e4f0f8" size="+0" underline="0" color="#000000"><b>User guide</b></font></A></td> |
---|
15 | <td width="36" bgcolor="#e4f0f8"><A HREF="User guide8_4.html"><IMG SRC="Images/leftarrow.png" BORDER="0" ALT="previous page"/></A><A HREF="User guide8_6.html"><IMG SRC="Images/rightarrow.png" BORDER="0" ALT="next page"/></A></td> |
---|
16 | </tr> |
---|
17 | </table> |
---|
18 | |
---|
19 | |
---|
20 | <br clear="all"/> |
---|
21 | |
---|
22 | <h2>8.5: Running it <a href="User guide8.html"><img src="Images/uparrow.png" border="0" align="top" alt="Go back up one level"/></a></h2> |
---|
23 | |
---|
24 | <p>When the main function is launched (click |
---|
25 | <a href="matlab: p=pwd();cd(fullfile(layoutRoot,'layoutHelp','Examples'));demoBrowser;cd(p)">here</a>) |
---|
26 | it first creates the data, then the GUI, then updates the GUI using the data. At this point the |
---|
27 | function exits and control is returned to the command prompt. Note, however, |
---|
28 | that the GUI is still onscreen and will still respond to user interaction.</p> |
---|
29 | <p>This works because the "shared" variables in the main function are not cleared when the |
---|
30 | function exits. They are only cleared once the GUI is closed. This is a slightly |
---|
31 | unusual, but very useful, feature of using nested functions for building |
---|
32 | applications.</p> |
---|
33 | <h3>For example:</h3> |
---|
34 | <pre style="background-color: #eeeeff; margin-left: 20px; margin-right: 20px"><font color="#000011">>> demoBrowser</font></pre> |
---|
35 | <p style="background-color: #ddddee; margin-left: 20px; margin-right: 20px"><font color="#000022"><center><img src="Images/demoBrowser4.png"/></center></font></p> |
---|
36 | |
---|
37 | <p><small>(Full source code for this application is available here: |
---|
38 | [ <a href="Examples/demoBrowser.m">view</a> |
---|
39 | | <a href="matlab: edit(fullfile(layoutRoot,'layoutHelp','Examples','demoBrowser.m'))">edit</a> |
---|
40 | | <a href="matlab: p=pwd();cd(fullfile(layoutRoot,'layoutHelp','Examples')); demoBrowser; cd(p)">run</a> ] |
---|
41 | )</small></p> |
---|
42 | |
---|
43 | |
---|
44 | <br clear="ALL"/> |
---|
45 | <table class="footer" width="100%" border="0" cellspacing="0" cellpadding="0"> |
---|
46 | <tr> |
---|
47 | <td width="18" height="15" bgcolor="#e4f0f8" align="left"><a href="User guide8_4.html"><img src="images/leftarrow.png" border="0" alt="previous page"/></a></td> |
---|
48 | <td width="40%" height="15" bgcolor="#e4f0f8" align="left"><a href="User guide8_4.html"><font face="arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">onListSelection</font></a></td> |
---|
49 | <td width="20%" height="15" bgcolor="#e4f0f8" align="center"><a href="index.html"><font face="arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">[Top]</font></a></td> |
---|
50 | <td width="40%" height="15" bgcolor="#e4f0f8" align="right"><a href="User guide8_6.html"><font face="arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">Scalability</font></a></td> |
---|
51 | <td width="18" height="15" bgcolor="#e4f0f8" align="right"><a href="User guide8_6.html"><img src="images/rightarrow.png" border="0" alt="next page"/></a></td> |
---|
52 | </tr> |
---|
53 | </table> |
---|
54 | <font face="Arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">© 2011 The MathWorks Ltd</font> |
---|
55 | <TT>• </TT><a href="matlab: helpview([matlabroot,'/license.txt'])">Terms of Use</a> |
---|
56 | <TT>• </TT><a href="matlab: helpview([matlabroot,'/patents.txt'])">Patents</a> |
---|
57 | <TT>• </TT><a href="matlab: helpview([matlabroot,'/trademarks.txt'])">Trademarks</a> |
---|
58 | |
---|
59 | </body> |
---|
60 | </html> |
---|
61 | |
---|