$te=Paw::Text_entry-new($width, [$cursor_color], [$color], [$name], [\&callback], [$text], [$side], [$echo], [$max_length] );>
Parameter
width => width of the text-entry (in other words: columns) color => the colorpair must be generated with Curses::init_pair(pair_nr, COLOR_fg, COLOR_bg) [optionally] cursor_color => same like color but only for the cursor name => name of the widget [optionally] callback => reference to the function that will be executed each time you press a key in the entry. [optionally] text => default text for the entry [optionally] orientation => "left"(default) or "right" for left/right-justified text. echo => 0, 1 oder 2 : 0=no echo of the entered text, 1=Stars instead of characters, 2=full echo (default) (0 and 1 good for passwords) [optional] max_length => maximum length of the entry (default = 1024)
Example
$te=Paw::Text_entry->new(width=>15, text=>"PLEASE ENTER NAME", max_length=>25);
Callback
The callback function will be started each time you press a key in the text-entry. The object reference ($this) and the key value will be given to the callback. This will give you the chance to allow only digits or whatever you want. You must return the key-value or no text will ever reach into the widget.
sub callback { my $this = shift; my $key = shift;
[... do some stuff ...] return $key; }
returns the text of the entry.
$text=$te->get_text();
set the text in the entry to $text.
$te->set_text("default");
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.
$te->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.
($xpos,$ypos)=$te->get_widget_pos();
Set a new color_pair for the widget.
$box->set_color(3);
activates the border of the widget (optionally also with shadows).
$widget->set_border("shade"); or $widget->set_border();
To install Paw, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Paw
CPAN shell
perl -MCPAN -e shell install Paw
For more information on module installation, please visit the detailed CPAN module installation guide.