Keywords: Cmenu

Next: Function Reference Up: Cmenu v1.1 Previous: General operation Contents

# Sample Script

The following script shows how a simple menu can be created. This is provided as a quick guide to creating user dialogs.

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 found in the installation directory; it will not be installed to your system during installation of the module.

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

Sample Script

1 | #!/usr/bin/perl |
2 |  |
3 | # Sample Cmenu script |
4 |  |
5 | menu_initialise("Cmenu Sample Script"); |
6 |  |
7 | menu_init("Menu Title","Menu Help Text"); |
8 |  |
9 | menu_item("Option 1","gimme1"); |
10 | menu_item("Option 2","gimme2"); |
11 |  |
12 | chop($sel menu_display("Menu Prompt")); |
13 |  |
14 | menu_terminate("bye bye"); |
15 |  |

Next: Function Reference Up: Cmenu v1.1 Previous: General operation Contents