Author image Uwe Gansert

Listbox

$lb=Paw::Listbox-new($height, $width, [$colored], [$name]);>

Parameter

     $height  => Number of rows

     $width   => Number of columns

     $colored => 1 turns on the colored mode
                 (see also "add_row") default=0 [optionally]

     $name    => Name of the widget [optionally]

Example

     $lb=Paw::Listbox->new(width=>10, height=>15, colored=>1);

clear_listbox()

deletes all entrys out of the listbox

Example

     $listbox->clear_listbox();

add_row($data, $color), add_row(\@data);

adds a data-row into the listbox. When the color mode is activated, you can give a second parameter as color-pair number. Alternatively you can give a refernce to an array to the listbox and it will put gradually each array element into the box. If the color mode is on, each second element of the array must be a color-pair number.

Example

     $listbox->add_row("Test", 3);

del_row($number)

deletes the row with the number "$number". Start counting at zero.

Example

     $listbox->del_row(4);

change_rows($first, $second);

swaps the $first and the $second row of the listbox.

Example

     $listbox->change_rows($lower, $upper);

number_of_data()

returns the number of data-rows in the listbox.

Example

     $data=$listbox->number_of_data();

get_pushed_rows("data"), get_pushed_rows("linenumbers");

returns an array of all pushed data-rows, either the linenumbers or the data.

Example

     @data_rows=$listbox->get_pushed_rows("linenumbers");

get_all_rows();

returns an array with the complete contents of the listbox.

Example

     @full_data=$listbox->get_all_rows();

abs_move_widget($new_x, $new_y)

the widget moves to the new absolute screen position. if you set only one of the two parameters, the other one keeps the old value.

Example

     $listbox->abs_move_widget( new_x=>5 );      #y-pos is the same

get_widget_pos()

returns an array of two values, the x-position and the y-position of the widget.

Example

     ($xpos,$ypos)=$listbox->get_widget_pos();

set_border(["shade"])

activates the border of the widget (optionally also with shadows).

Example

     $widget->set_border("shade"); or $widget->set_border();