3 lines
4.1 KiB
HTML
3 lines
4.1 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>Getting Menus to Do Stuff </title><link href="navigation.css" rel="stylesheet" type="text/css"/><link href="document.css" rel="stylesheet" type="text/css"/></head><body><p class="top_nav"><a href="part80.htm">< Previous</a><span> | </span><a href="../Medley-Primer.html">Contents</a><span> | </span><a href="part82.htm">Next ></a></p><h2 style="padding-left: 35pt;text-indent: 0pt;text-align: left;">Getting Menus to Do Stuff </h2><p style="padding-top: 9pt;padding-left: 107pt;text-indent: 0pt;text-align: justify;">One way to make a menu do things is to specify more about the menu items. Instead of items simply being the strings or atoms that will appear in the menu, items can be lists, each list with three elements (see Figure 13-3). The first element of each list is what</p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;">will appear in the menu; the second expression is what is evaluated, and the results of the evaluation returned, when the item is selected; and the third expression is the</p><p style="padding-bottom: 1pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">expression that should be printed in the Prompt window when a mouse button is held down while the mouse is pointing to that menu item. This third item should be thought of as help text for the user. If the third element of the list is NIL, the system responds with <b>Will select this item w hen you release the button</b>.</p><p style="padding-left: 148pt;text-indent: 0pt;text-align: left;"><span><img width="435" height="416" alt="image" src="Image_089.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 13-3. Creating a Menu to do Things, then displaying it with the function</p><p class="s3" style="padding-left: 111pt;text-indent: 0pt;text-align: center;">ADDMENU</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-top: 4pt;padding-left: 107pt;text-indent: 0pt;line-height: 107%;text-align: left;">Now when an item is selected from <span class="s3">MY.MENU2</span>, something will happen. When a mouse button is held down, the expression typed as the third element in the item’s</p><p style="padding-left: 107pt;text-indent: 0pt;line-height: 11pt;text-align: left;">specification will be printed in the Prompt window. (See Figure 13-4.)</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 107pt;text-indent: 0pt;text-align: left;"><span><img width="552" height="111" alt="image" src="Image_090.gif"/></span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 13-4. Mouse Button Held Down While Mouse Cursor SeIects <span class="s3">NEXT.QUESTION</span></p><p style="text-indent: 0pt;text-align: left;"><br/></p><p style="padding-bottom: 1pt;padding-left: 107pt;text-indent: 0pt;text-align: left;">When the mouse button is released (i.e., the item is selected) the expression that was typed as the second element of the item’s specification will be run. (See Figure 13-5.)</p><p style="padding-left: 174pt;text-indent: 0pt;text-align: left;"><span><img width="364" height="156" alt="image" src="Image_091.gif"/></span></p><p style="padding-top: 5pt;padding-left: 111pt;text-indent: 0pt;text-align: center;">Figure 13-5. <span class="s3">NEXT-QUESTION </span>Selected</p><p style="text-indent: 0pt;text-align: left;"><br/></p><p class="nav"> </p><p class="nav"> </p><p class="nav"><a href="part80.htm">< Previous</a><span> | </span><a href="../Medley-Primer.html">Contents</a><span> | </span><a href="part82.htm">Next ></a></p><p class="nav"> </p></body></html>
|