view release on metacpan or search on metacpan
@ISA = qw(Exporter);
# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.
@EXPORT = qw(
menu_initialise
menu_init
menu_item
menu_display
menu_show
menu_popup
menu_button_set
menu_terminate
);
@EXPORT_OK = qw (
$menu_sep
$menu_sepn
);
$Cmenu::VERSION ='1.01';
# &echo();
# &nocbreak();
# &curs_set(1);
# keypad control is only applied to new windows which should always be destroyed
# before returning.
# ----------------------------------------------------------------------------------
# &menu_initialise : sets up all menu variables and constructs
# &menu_button_set : swicthes menu buttons on and off
# &menu_item : create a menu item
# &menu_display : display a menu and get a response from it
# &menu_popup : flash a busy window
# &menu_show : gives a full screen text display
# &menu_terminate : close the menu environment down
# ----------------------------------------------------------------------------------
# All Curses functions can of course be used in user programs but be aware that
# management of all windows then becomes the users responsibility and behaviour
# of the menuing environment may be unpredictable
# ##################################################################################
# ##################################################################################
# Variable Definitions
# Keystroke arrays
my %kseq=(); # hash for function key translation
my $key_max=0; # longest keystroke
# Windows
my $menu_screen; # the backdrop
my $menu_inlay; # background for the menu window with shadow etc
my $menu_window; # menu window with text elements
my $menu_pane; # where the menu options actually get drawn
my $menu_popup; # special for popup and splash displays
# Window elements
my $menu_title; # title of script in backdrop
my $menu_top_title; # title of menu
my $menu_sub_title; # sub-title of a menu
my $menu_sub_title_lines; # depth of sub-title
my $menu_advice; # message at foot of backdrop
my $menu_item_pos; # where menu items will start
my $menu_indent; # where menu item labels will start
$menu_attributes{"button"}="7.7.BOLD";
$menu_attributes{"scroll"}="2.7.BOLD";
$menu_attributes{"rtext"}="7.4.BOLD";
$menu_attributes{"rtitle"}="6.4.BOLD";
$menu_attributes{"roption"}="3.4.BOLD";
$menu_attributes{"edge"}="7.7.BOLD";
$menu_attributes{"dull"}="0.7.BOLD";
$menu_attributes{"help"}="0.2.BOLD";
$menu_attributes{"warn"}="7.3.NORMAL";
$menu_attributes{"error"}="7.1.NORMAL";
$menu_attributes{"popup"}="3.2.BOLD";
$menu_attributes{"shadow"}="0.0.NORMAL";
} else {
# Set mono defaults
$menu_attributes{"backdrop"}="DIM";
$menu_attributes{"advice"}="NORMAL";
$menu_attributes{"text"}="NORMAL";
$menu_attributes{"title"}="NORMAL";
$menu_attributes{"option"}="BOLD";
$menu_attributes{"button"}="DIM";
$menu_attributes{"scroll"}="NORMAL";
$menu_attributes{"rtext"}="REVERSE";
$menu_attributes{"rtitle"}="REVERSE";
$menu_attributes{"roption"}="REVERSE|BLINK";
$menu_attributes{"edge"}="DIM";
$menu_attributes{"dull"}="DIM";
$menu_attributes{"help"}="REVERSE";
$menu_attributes{"warn"}="REVERSE";
$menu_attributes{"error"}="REVERSE";
$menu_attributes{"popup"}="NORMAL";
}
if(-e "/etc/Cmenu/cmenurc") {
# load system wide preferences
&menu_config_file("/etc/Cmenu/cmenurc");
}
if(-e "~/.cmenurc") {
# Load the users specific preferences
&menu_config_file("~/.cmenurc");
}
if(-e "cmenurc") {
# ##################################################################################
# Splash screen for Popups and Text displays
# ##################################################################################
#**********
# MENU_POPUP
#
# Function: Pops up a single line text message
# Can be used to keep users interested while a lengthy process
# completes; popup remains on screen until destroyed by
# calling the routine again with no message
#
# Call format: &menu_popup(message,title); # create a popup
# &menu_popup(); # destroy popup
#
# Arguments: - message - a text message to be displayed;
# should be single line only, will be truncated if too long
# If the message is empty an old popup will be destroyed
# - title - title centred in the popup border
# defaults to "processing" if not provided
#
# Returns: nothing
#
# Notes: popup may appear over a blank screen since the menu windows
# may have been removed (not guaranteed)
#**********
sub menu_popup {
my ($message,$ptitle) = @_;
if(!$ptitle) {$ptitle="processing"; }
&menu_advice(" ");
if(!$message) {
# no message so destroy the old popup
# curses cookery
echo(); # no input echo until enabled explicitly
curs_set(1); # turn the cursor on
&delwin($menu_popup);
&menu_redraw_backdrop();
} else {
# create a new popup
noecho(); # no input echo until enabled explicitly
curs_set(0); # turn the cursor off
while(length($message)>$menu_screen_cols-8) {
chop $message;
};
# Initialise menu pane and control variables
$menu_popup=newwin(3,$menu_screen_cols-6,($menu_screen_lines/2)-2,3);
bkgd($menu_popup,$menu_attributes{"popup"});
clear($menu_popup);
&border($menu_popup,0,0,0,0,0,0,0,0);
move($menu_popup,0,($menu_screen_cols-8-length($ptitle))/2);
addstr($menu_popup," $ptitle ");
move($menu_popup,1,($menu_screen_cols-6-length($message))/2);
addstr($menu_popup,$message);
&refresh($menu_popup);
&doupdate();
}
}
#**********
# MENU_SHOW
#
# Function: Pops up a text message with a button bar
# Used as a user confirmation advice before a process
# is performed
# any additional text; no scrolling supported yet
#
# Useful as a debugging tool for your own scripts to see
# what is going one since "print" will not work under
# Curses.
#
#**********
sub menu_show {
my ($temp_title,$message,$colour) = @_;
my ($attributes,$work,$x,$i,$j);
my ($menu_popup);
my (@b);
&menu_advice(" ");
if(!$colour) { $colour="ERROR"; }
SET_COLOR: for ($colour) {
/WARN/ && do {
$attributes=$menu_attributes{"warn"};
};
/HELP/ && do {
};
/ERROR/ && do {
$attributes=$menu_attributes{"error"};
};
};
if(!$message) {
# no message given so ignore the call
return("NO");
} else {
# create a popup with button bar
bkgd($menu_inlay,$attributes);
erase($menu_inlay);
&border($menu_inlay,0,0,0,0,0,0,0,0);
move($menu_inlay,0,($menu_inlay_cols-length($temp_title)-2)/2);
addstr($menu_inlay," $temp_title ");
&noutrefresh($menu_inlay);
# Initialise menu pane and control variables
# First define window and draw border
$menu_pane_y=$menu_inlay_y+1;
$menu_pane_x=$menu_inlay_x+1;
$menu_pane_lines=$menu_inlay_lines-3;
$menu_pane_cols=$menu_inlay_cols-2;
&noutrefresh($menu_inlay);
$menu_popup=newwin($menu_pane_lines-2,$menu_pane_cols-2,$menu_pane_y,$menu_pane_x+1);
bkgd($menu_popup,$attributes);
erase($menu_popup);
# curses cookery
cbreak(); # permits keystroke examination
noecho(); # no input echo until enabled explicitly
curs_set(0); # turn the cursor off
if(length($message)<$menu_pane_cols) {
move($menu_popup,$menu_pane_lines/2,($menu_pane_cols-length($message))/2);
addstr($menu_popup,$message);
&refresh($menu_popup);
} else {
$Text::Wrap::columns=$menu_pane_cols-2;
addstr($menu_popup,wrap("","",$message));
&refresh($menu_popup);
}
if($colour eq "HELP") {
# We have to do this since HELP can be called while in a menu
# when menu_show would otherwise trash the button labels
move($menu_inlay,$menu_inlay_lines-2,($menu_inlay_cols/2)-7);
&attrset($menu_inlay,$attributes|A_BOLD);
addstr($menu_inlay,"<Press any Key>");
&refresh($menu_inlay);
getch($menu_inlay);
} else {
last CONFIRM;
};
$work="";
};
} until ($work ne "");
}
# curses cookery
nocbreak(); # permits keystroke examination
echo(); # no input echo until enabled explicitly
curs_set(1); # turn the cursor on
&delwin($menu_popup);
&menu_redraw_backdrop();
}
$work;
}
# ##################################################################################
# End of Module
# ##################################################################################
&menu_init($title,$sub-title,$topest,$menu_help);
&menu_item($item_text,$item_label,$item_style,$item_data,$item_pos)
&menu_item($item_text,$item_label,$item_style,$item_data,$item_pos)
...
&menu_item($item_text,$item_label,$item_style,$item_data,$item_pos)
$sel=&menu_display($advice,$start_item);
&menu_button_set($button,$button_text);
&menu_popup($title,$text);
...
&menu_popup();
&menu_show($title,$text,$colour);
&menu_terminate($message);
=head1 DESCRIPTION
CMENU is a Perl Module designed to provide functions for the
creation of menus in perl scripts.
This routine switches buttons on and off and, specifies the text label of the button
(button actions cannot be altered yielding "ACCEPT", "HELP" or "EXIT" although your
scripts can interret these responses however you wish). The <TAB> key
traverses the buttons bar.
Parameters for this routine are;
$button a number 1, 2 or 3 specifying which button is to be set
$label the text label for the button; an empty string switches the button off
=head2 menu_popup
Allows a simple screen to pop-up if a lengthy process has been launched. The popup
has only one line of text to give an indication of what the system is doing;
To start a popup - call with $message
To close a popup - call with NO message
Remember to close the popup or the menu display will get confused.
=head2 menu_show
Allows a variety of information to be shown on the screen; the display
generally replaces normal menu rendering until the user presses an approriate key.
The routines takes 3 parameters
$title the title of the display
$message the message to be displayed. If this is only one line it will be
centred; if longer the external routine Text::wrap is used to
manipulated the text to fit on the screen. Text formatting
#C::rtext :7.4.BOLD
#C::rtitle :6.4.BOLD
#C::roption :3.4.BOLD
#: Line drawing
#C::edge :7.7.BOLD
#C::dull :0.7.BOLD
#: Splash screens
#C::help :3.2
#C::warn :7.3
#C::error :7.1
#C::popup :3.2.BOLD
#: box shadow on colour screens
#C::shadow :0.0
#:------------------------------------------------
#:Monochrome rendition
#: defined as Curses toggles from
#: NORMAL | BOLD | REVERSE
#: STANDOUT | BLINK | UNDERLINE | DIM
#: depends what the terminal supports; not all may
#: render distinctly from others if they work at all
#:------------------------------------------------
#M::button :DIM
#M::scroll :NORMAL
#M::rtext :REVERSE
#M::rtitle :REVERSE
M::roption :REVERSE|BOLD
#M::edge :DIM
#M::dull :DIM
#M::help :REVERSE
#M::warn :REVERSE
#M::error :REVERSE
#M::popup :NORMAL
#:
#:Key sequences
#:================================================
#:Key sequences are terminal specific or provided
#:by curses
#:------------------------------------------------
#:Key sequences are specified as follows
#K:Key sequence :##:CODE
#K:----------------------:##:----
#: Fields seperated by : where
contrib/sqlmenu view on Meta::CPAN
}
&menu_item($row[2],$head);
printf(OUT "%d %s %s\n",$i,$head,$row[2]);
}
close(OUT);
$sel=&menu_display("Press OK to Print");
chop($sel);
if(($sel eq "%EMPTY%")||($sel eq "%UP%")) {
$sel="";
} else {
&menu_popup("Printing","Sending Data to Printer");
system("lpr -Pbj /tmp/foodout");
system("rm /tmp/foodout");
&menu_popup();
}
}
$last_option=2;
last SUB_MENU;
};
/shopclear/ && do {
&menu_popup("Removing all Flagged Items","Clearing Shopping List");
$result=$conn->exec("SELECT * FROM food WHERE buy > 0");
$numrows=$result->ntuples();
for($i=0;$i<$numrows;$i++) {
@row=$result->fetchrow;
$clear=$conn->exec("UPDATE food SET buy = 0, update = CURRENT_TIMESTAMP WHERE foodid = $row[0]");
}
$last_option=3;
&menu_popup();
last SUB_MENU;
};
/foodadd/ && do {
$cat=&fooditem();
if($cat>0) {
$head=getcat($cat);
&menu_init("New Item","Add new item to category $head");
&menu_item($cat,"Category",4);
&menu_item($food,"Item",6,$cat,"20 0 0");
$sel=&menu_display("Edit Item",2);
if($sel eq "%EMPTY%") {
$sel="You pressed the <EXIT> function Key";
} else {
$sel="You selected the <$sel> field";
}
&menu_show("Selected Item",$sel,HELP);
}
# ---< menu 6 >----------------------------------------------------
# This option does a word count on the script, holds a processing popup for a while
# and then displays the results
sub menu06 {
&menu_button_set(1,"Accept");
&menu_button_set(2,"");
&menu_button_set(3,"Reject");
&menu_popup("Counting the number of words in this script");
system("wc demo >yum");
open(IN,"<yum");
while(<IN>) {
chop;
($wcl,$wcw,$wcb,$wcf)=split;
}
close(IN);
system("rm yum");
system("sleep 2");
$yum="\n Line count = $wcl\n Word count = $wcw\n Byte count = $wcb\nfor file $wcf\n";
&menu_popup();
$yum="This is the results of calling wc on file demo although it is not formated properly it may look half decent".$yum;
# Here we show how to catch the results of a popup screen
$sel=&menu_show("Confirm Word-count",$yum,WARN);
&menu_button_set(1,"Continue");
&menu_button_set(3,"");
if($sel eq "YES") {
&menu_show("Word Count Accepted",$yum,HELP);
} else {
&menu_show("Word Count Rejected",$yum,ERROR);
}
}
doc/Cmenu.tex view on Meta::CPAN
This section provides a comprehensive list of user functions provided by the module explaining their use and calling parameters.
\subsection{User Functions}
These functions are designed to be called by user scripts.
\begin{description}
\item [menu\_button\_set] enables or disables buttons; sets text on button
\item [menu\_display] call to activate a menu and return a selection
\item [menu\_init] initialise a new menu structure
\item [menu\_initialise] initialise the module; called at the beginning of a script once only
\item [menu\_item] define a menu option
\item [menu\_popup] popup a display while processing is occurring
\item [menu\_show] splash data to the screen
\item [menu\_terminate] terminate all Curse and menuing structures; called on exit from script
\end{description}
\subsection{menu\_initialise}
Its job is to create a Curses environment and configure Cmenu to operate effectively with your terminal providing some default values for variables. It accepts tow variables and is called like this;
\begin{center}
menu\_initialise("My System","Menu Prompt");
\end{center}
doc/Cmenu.tex view on Meta::CPAN
(\$identifier,\$contents) = split(\$Cmenu::menu\_sepn/,\$value[1]);
\end{center}
Notice that \$value[1] is one of the elements of the first array. Normally, values returned in this way will be ordered as they were defined with menu\_item calls but this is not guaranteed. The \$identifier is the value specified in the original \$m...
Where this return value can get really messy is when a complex data entry menu has a combination of regular, alpha, numeric, radio and check list menu items. You will need to take care that you identify all the parts you need for each item. When in d...
\begin{center}
\&menu\_show(``Data Response'',\$sel,''HELP'');
\end{center}
This will show what Cmenu is returning from a particular call.
\subsection{menu\_popup}
This is an extra routine which you may never need. It provides a way of displaying information while a process is being performed rather than the script stalling silently. It is called in two forms; first to display the popup and then to remove it;
\begin{description}
\item [menu\_popup(\$header,\$message)] This creates a popup which overlays the current menu. A very small window is opened with a drawn border and \textbf{\$header} displayed in the centre of the top line. The \textbf{\$message} is displayed in the ...
After calling this, your script should go off and busy itself until ready to talk to the user again
\item [menu\_popup()] call the same routine with no parameters and the Popup menu will be removed.
\end{description}
Please remember to close the popup as dangling windows can trash your display.
\subsection{menu\_show(\$title,\$message,\$style)}
This provides for splash screens to be shown to the user either reporting difficulties, errors, providing help or asking for confirmation of responses. The routine draws a full window covering the normal menu space (not the backdrop). It accepts thre...
\begin{description}
\item [\$title] Gives the window a title included in the border
\item [\$message] provides the actual text message. If this can be fitted onto a single line, it will be centred in the screen. If the text exceeds a single line width, it will be passed through \textbf{Text::Wrap} for formating. \textbf{Text::Wrap} ...
\item [\$style] using different colours, a different meaning can be associated with splash screens. Also a simple button bar will be drawn for each type so that users can confirm or reject options as required. Responses from menu\_show will be either...
\begin{description}
\item [``HELP''] uses the help colour scheme (brown on grey); also automatically provides a single button.
\item [``WARN''] uses the warning colour scheme as used by the popup screens (defaults to yellow on green). User definable button bar available (see button\_set).
\item [``ERROR''] uses the error colour scheme (white on red) with an active button bar.
\end{description}
Splash screen are exited by pressing any normal key. Usually function keys are rejected.
\end{description}
\subsection{Internal Functions}
These are the internal functions of the module; these should not be called by user scripts.
\begin{description}
\item [menu\_advice] displays a short message at the foot of the screen
\item [menu\_button\_bar] creates a button bar
doc/html/Cmenu.html view on Meta::CPAN
HREF="node10.html">menu_item</A>
<LI><A NAME="tex2html16"
HREF="node11.html">menu_display</A>
<UL>
<LI><A NAME="tex2html17"
HREF="node12.html">Processing return Values</A>
</UL>
<LI><A NAME="tex2html18"
HREF="node13.html">Complex Return Values</A>
<LI><A NAME="tex2html19"
HREF="node14.html">menu_popup</A>
<LI><A NAME="tex2html20"
HREF="node15.html">menu_show($title,$message,$style)</A>
<LI><A NAME="tex2html21"
HREF="node16.html">Internal Functions</A>
</UL>
<LI><A NAME="tex2html22"
HREF="node17.html">Application Preferences</A>
<LI><A NAME="tex2html23"
HREF="node18.html">tic file</A>
<LI><A NAME="tex2html24"
doc/html/index.html view on Meta::CPAN
HREF="node10.html">menu_item</A>
<LI><A NAME="tex2html16"
HREF="node11.html">menu_display</A>
<UL>
<LI><A NAME="tex2html17"
HREF="node12.html">Processing return Values</A>
</UL>
<LI><A NAME="tex2html18"
HREF="node13.html">Complex Return Values</A>
<LI><A NAME="tex2html19"
HREF="node14.html">menu_popup</A>
<LI><A NAME="tex2html20"
HREF="node15.html">menu_show($title,$message,$style)</A>
<LI><A NAME="tex2html21"
HREF="node16.html">Internal Functions</A>
</UL>
<LI><A NAME="tex2html22"
HREF="node17.html">Application Preferences</A>
<LI><A NAME="tex2html23"
HREF="node18.html">tic file</A>
<LI><A NAME="tex2html24"
doc/html/node1.html view on Meta::CPAN
HREF="node8.html">menu_initialise</A>
<LI><A NAME="tex2html43"
HREF="node9.html">menu_init</A>
<LI><A NAME="tex2html44"
HREF="node10.html">menu_item</A>
<LI><A NAME="tex2html45"
HREF="node11.html">menu_display</A>
<LI><A NAME="tex2html46"
HREF="node13.html">Complex Return Values</A>
<LI><A NAME="tex2html47"
HREF="node14.html">menu_popup</A>
<LI><A NAME="tex2html48"
HREF="node15.html">menu_show($title,$message,$style)</A>
<LI><A NAME="tex2html49"
HREF="node16.html">Internal Functions</A>
</UL>
<LI><A NAME="tex2html50"
HREF="node17.html">Application Preferences</A>
<LI><A NAME="tex2html51"
HREF="node18.html">tic file</A>
<LI><A NAME="tex2html52"
doc/html/node13.html view on Meta::CPAN
<A NAME="tex2html193"
HREF="node12.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="file:/usr/lib/latex2html/icons/prev.png"></A>
<A NAME="tex2html201"
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="tex2html204"
HREF="node14.html">menu_popup</A>
<B> Up:</B> <A NAME="tex2html200"
HREF="node6.html">Function Reference</A>
<B> Previous:</B> <A NAME="tex2html194"
HREF="node12.html">Processing return Values</A>
  <B> <A NAME="tex2html202"
HREF="node1.html">Contents</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
doc/html/node13.html view on Meta::CPAN
<A NAME="tex2html193"
HREF="node12.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="file:/usr/lib/latex2html/icons/prev.png"></A>
<A NAME="tex2html201"
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="tex2html204"
HREF="node14.html">menu_popup</A>
<B> Up:</B> <A NAME="tex2html200"
HREF="node6.html">Function Reference</A>
<B> Previous:</B> <A NAME="tex2html194"
HREF="node12.html">Processing return Values</A>
  <B> <A NAME="tex2html202"
HREF="node1.html">Contents</A></B>
<!--End of Navigation Panel-->
<ADDRESS>
Andy Ferguson (AFC)
2001-10-20
doc/html/node14.html view on Meta::CPAN
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 99.2beta8 (1.43)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>menu_popup</TITLE>
<META NAME="description" CONTENT="menu_popup">
<META NAME="keywords" CONTENT="Cmenu">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="LaTeX2HTML v99.2beta8">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="Cmenu.css">
doc/html/node14.html view on Meta::CPAN
HREF="node6.html">Function Reference</A>
<B> Previous:</B> <A NAME="tex2html206"
HREF="node13.html">Complex Return Values</A>
  <B> <A NAME="tex2html214"
HREF="node1.html">Contents</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<H2><A NAME="SECTION00057000000000000000">
menu_popup</A>
</H2>
This is an extra routine which you may never need. It provides a way of displaying information while a process is being performed rather than the script stalling silently. It is called in two forms; first to display the popup and then to remove it;
<DL>
<DT><STRONG>menu_popup($header,$message)</STRONG></DT>
<DD>This creates a popup which overlays the current menu. A very small window is opened with a drawn border and <B>$header</B> displayed in the centre of the top line. The <B>$message</B> is displayed in the body of the window on a single line (no wo...
<P>
After calling this, your script should go off and busy itself until ready to talk to the user again
</DD>
<DT><STRONG>menu_popup()</STRONG></DT>
<DD>call the same routine with no parameters and the Popup menu will be removed.
</DD>
</DL>
Please remember to close the popup as dangling windows can trash your display.
<P>
<BR><HR>
<ADDRESS>
Andy Ferguson (AFC)
2001-10-20
</ADDRESS>
</BODY>
</HTML>
doc/html/node15.html view on Meta::CPAN
<A NAME="tex2html225"
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="tex2html228"
HREF="node16.html">Internal Functions</A>
<B> Up:</B> <A NAME="tex2html224"
HREF="node6.html">Function Reference</A>
<B> Previous:</B> <A NAME="tex2html218"
HREF="node14.html">menu_popup</A>
  <B> <A NAME="tex2html226"
HREF="node1.html">Contents</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<H2><A NAME="SECTION00058000000000000000">
menu_show($title,$message,$style)</A>
</H2>
This provides for splash screens to be shown to the user either reporting difficulties, errors, providing help or asking for confirmation of responses. The routine draws a full window covering the normal menu space (not the backdrop). It accepts thre...
doc/html/node15.html view on Meta::CPAN
<DT><STRONG>$message</STRONG></DT>
<DD>provides the actual text message. If this can be fitted onto a single line, it will be centred in the screen. If the text exceeds a single line width, it will be passed through <B>Text::Wrap</B> for formating. <B>Text::Wrap</B> breaks lines at wo...
</DD>
<DT><STRONG>$style</STRONG></DT>
<DD>using different colours, a different meaning can be associated with splash screens. Also a simple button bar will be drawn for each type so that users can confirm or reject options as required. Responses from menu_show will be either ``YES'' or `...
<DL>
<DT><STRONG>``HELP''</STRONG></DT>
<DD>uses the help colour scheme (brown on grey); also automatically provides a single button.
</DD>
<DT><STRONG>``WARN''</STRONG></DT>
<DD>uses the warning colour scheme as used by the popup screens (defaults to yellow on green). User definable button bar available (see button_set).
</DD>
<DT><STRONG>``ERROR''</STRONG></DT>
<DD>uses the error colour scheme (white on red) with an active button bar.
</DD>
</DL>
Splash screen are exited by pressing any normal key. Usually function keys are rejected.
</DD>
</DL>
<P>
doc/html/node15.html view on Meta::CPAN
<A NAME="tex2html225"
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="tex2html228"
HREF="node16.html">Internal Functions</A>
<B> Up:</B> <A NAME="tex2html224"
HREF="node6.html">Function Reference</A>
<B> Previous:</B> <A NAME="tex2html218"
HREF="node14.html">menu_popup</A>
  <B> <A NAME="tex2html226"
HREF="node1.html">Contents</A></B>
<!--End of Navigation Panel-->
<ADDRESS>
Andy Ferguson (AFC)
2001-10-20
</ADDRESS>
</BODY>
</HTML>
doc/html/node6.html view on Meta::CPAN
HREF="node10.html">menu_item</A>
<LI><A NAME="tex2html116"
HREF="node11.html">menu_display</A>
<UL>
<LI><A NAME="tex2html117"
HREF="node12.html">Processing return Values</A>
</UL>
<LI><A NAME="tex2html118"
HREF="node13.html">Complex Return Values</A>
<LI><A NAME="tex2html119"
HREF="node14.html">menu_popup</A>
<LI><A NAME="tex2html120"
HREF="node15.html">menu_show($title,$message,$style)</A>
<LI><A NAME="tex2html121"
HREF="node16.html">Internal Functions</A>
</UL>
<!--End of Table of Child-Links-->
<BR><HR>
<ADDRESS>
Andy Ferguson (AFC)
2001-10-20
doc/html/node7.html view on Meta::CPAN
</DD>
<DT><STRONG>menu_init</STRONG></DT>
<DD>initialise a new menu structure
</DD>
<DT><STRONG>menu_initialise</STRONG></DT>
<DD>initialise the module; called at the beginning of a script once only
</DD>
<DT><STRONG>menu_item</STRONG></DT>
<DD>define a menu option
</DD>
<DT><STRONG>menu_popup</STRONG></DT>
<DD>popup a display while processing is occurring
</DD>
<DT><STRONG>menu_show</STRONG></DT>
<DD>splash data to the screen
</DD>
<DT><STRONG>menu_terminate</STRONG></DT>
<DD>terminate all Curse and menuing structures; called on exit from script
</DD>
</DL>
<P>