1
0
mirror of synced 2026-04-20 09:56:12 +00:00
Files
Interlisp.medley/docs/html-primer/Medley-Primer_files/part81.htm
2021-01-22 22:41:07 +00:00

3 lines
4.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!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">&lt; Previous</a><span> | </span><a href="../Medley-Primer.html">Contents</a><span> | </span><a href="part82.htm">Next &gt;</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 items</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 items 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">&nbsp;&nbsp;</p><p class="nav">&nbsp;</p><p class="nav"><a href="part80.htm">&lt; Previous</a><span> | </span><a href="../Medley-Primer.html">Contents</a><span> | </span><a href="part82.htm">Next &gt;</a></p><p class="nav">&nbsp;&nbsp;</p></body></html>