
$button=Paw::Button-new([$color], [$name], [\&callback], [$label]);>
Parameter
color => the colorpair must be generated with
Curses::init_pair(pair_nr, COLOR_fg, COLOR_bg)
[optionally]
name => name of the button [optionally]
callback => reference to the function which will be called
when pushing the button. [optionally]
label => text in the button. If the button contains text,
it is not possible to see if it is pushed or not.
[optionally]
Example
$button=Paw::Button->new(callback=>\&button_callback);
Callback
sub button_callback {
my $this = shift; # Referenz to the button
$data = $edit->get_text();
$box->add_row($data);
return;
}
Sets the button into the status " pressed "
Example
$button->set_button(); # [x]
Sets the button into the status "not pressed"
Example
$button->release_button(); # [ ]
the button changes it status.
Example
$button->push_button(); # [x]->[ ], [ ]->[x]
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
$button->abs_move_widget( new_x=>5 ); #y-pos is the same
returns an array of two values, the x-position and the y-position of the widget.
Example
($xpos,$ypos)=$button->get_widget_pos();
Set a new color_pair for the widget.
Example
$button->set_color(3);
activates the border of the widget (optionally also with shadows).
Example
$widget->set_border("shade"); or $widget->set_border();