Cmenu

 view release on metacpan or  search on metacpan

doc/html/node5.html  view on Meta::CPAN

<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
 SRC="file:/usr/lib/latex2html/icons/prev.png"></A> 
<A NAME="tex2html96"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
 SRC="file:/usr/lib/latex2html/icons/contents.png"></A>  
<BR>
<B> Next:</B> <A NAME="tex2html99"
  HREF="node6.html">Function Reference</A>
<B> Up:</B> <A NAME="tex2html95"
  HREF="Cmenu.html">Cmenu v1.1</A>
<B> Previous:</B> <A NAME="tex2html89"
  HREF="node4.html">General operation</A>
 &nbsp <B>  <A NAME="tex2html97"
  HREF="node1.html">Contents</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->

<H1><A NAME="SECTION00040000000000000000">
Sample Script</A>
</H1>
The following script shows how a simple menu can be created. This is provided as a quick guide to creating user dialogs. 

<P>
A more comprehensive example script is provided with the distribution as a test script to verify the correct installation of the module; it also serves as a demonstration of all the features provided by the module. This demonstration script can be fo...

<P>
In the following script, elements presented in <B>bold</B> are functions or variables provided by Cmenu, elements in <I>italics</I> are items provided by the user, all other text are generic perl instructions.

<P>
<DIV ALIGN="CENTER">
<B>Sample Script
<BR></B>
<TABLE CELLPADDING=3 BORDER="1">
<TR><TD ALIGN="RIGHT">1</TD>
<TD ALIGN="LEFT">#!/usr/bin/perl</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
<TR><TD ALIGN="RIGHT">2</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
<TR><TD ALIGN="RIGHT">3</TD>
<TD ALIGN="LEFT"># Sample Cmenu script</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
<TR><TD ALIGN="RIGHT">4</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
<TR><TD ALIGN="RIGHT">5</TD>
<TD ALIGN="LEFT"><B>menu_initialise</B>(<I>"Cmenu Sample Script"</I>);</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
<TR><TD ALIGN="RIGHT">6</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
<TR><TD ALIGN="RIGHT">7</TD>
<TD ALIGN="LEFT"><B>menu_init</B>(<I>"Menu Title"</I>,<I>"Menu Help Text"</I>);</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
<TR><TD ALIGN="RIGHT">8</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
<TR><TD ALIGN="RIGHT">9</TD>
<TD ALIGN="LEFT"><B>menu_item</B>(<I>"Option 1"</I>,<I>"gimme1"</I>);</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
<TR><TD ALIGN="RIGHT">10</TD>
<TD ALIGN="LEFT"><B>menu_item</B>(<I>"Option 2"</I>,<I>"gimme2"</I>);</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
<TR><TD ALIGN="RIGHT">11</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
<TR><TD ALIGN="RIGHT">12</TD>
<TD ALIGN="LEFT">chop($sel <IMG
 WIDTH="20" HEIGHT="19" ALIGN="BOTTOM" BORDER="0"
 SRC="img1.png"
 ALT="$=$"> <B>menu_display</B>(<I>"Menu Prompt"</I>));</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
<TR><TD ALIGN="RIGHT">13</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
<TR><TD ALIGN="RIGHT">14</TD>
<TD ALIGN="LEFT"><B>menu_terminate</B>(<I>"bye bye"</I>);</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
<TR><TD ALIGN="RIGHT">15</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
</TABLE>
</DIV>

<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html98"
  HREF="node6.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
 SRC="file:/usr/lib/latex2html/icons/next.png"></A> 
<A NAME="tex2html94"
  HREF="Cmenu.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
 SRC="file:/usr/lib/latex2html/icons/up.png"></A> 
<A NAME="tex2html88"
  HREF="node4.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
 SRC="file:/usr/lib/latex2html/icons/prev.png"></A> 
<A NAME="tex2html96"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
 SRC="file:/usr/lib/latex2html/icons/contents.png"></A>  
<BR>
<B> Next:</B> <A NAME="tex2html99"
  HREF="node6.html">Function Reference</A>
<B> Up:</B> <A NAME="tex2html95"
  HREF="Cmenu.html">Cmenu v1.1</A>
<B> Previous:</B> <A NAME="tex2html89"
  HREF="node4.html">General operation</A>
 &nbsp <B>  <A NAME="tex2html97"
  HREF="node1.html">Contents</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>
Andy Ferguson (AFC)
2001-10-20
</ADDRESS>
</BODY>
</HTML>



( run in 0.605 second using v1.01-cache-2.11-cpan-39bf76dae61 )