Uwe Gansert > Paw-0.54 > Paw::Popup_menu

Download:
Paw-0.54.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Source  

Listbox ^

$lb= new Paw::Popup_menu ( \@data, [$size], [$width], [$default], [$color], [\&callback], [$name]);

Parameter

     \@data     => Reference to an array that contains the entries

     $size      => Number of entries that are shown without scrolling,
                   if the widget is pushed [default is 5]

     $width     => Number of columns [default is 15]

     $default   => Number of the default element (starting at 0) 
                   [default is 0]

     $name      => Name of the widget [optionally]

     $color     => the colorpair must be generated with
                   Curses::init_pair(pair_nr, COLOR_fg, COLOR_bg)
                   [optionally]
     
     \&callback => will be called when the value has changed. 
                   the $this reference is given to it and no return value will be parsed

Example

     $data = [ "one", "two", "three", "four" ];
     $pm=Paw::Popup_menu->new( data => $data, width=>10, size=>8 );

get_choice()

returns the choosen value of the box as string

Example

  $choice = $pm->get_choice();

set_choice($number)

sets the choosen value of the box. $number is the element number in the array

Example

  $pm->set_choice(3);