-
Notifications
You must be signed in to change notification settings - Fork 0
The TextArea
Saif Ahmed edited this page Dec 17, 2022
·
4 revisions
A text area allows editing of multi-line text data entry. The text-box is independent of any Graille canvases. when the focus is on the text box, key presses lead to character inputs into the text area, word wrapping is currently not implemented, cursor presses allows navigating the text area. The text area can be longer or wider than the available window. Future versions will allow selection of text and cut and paste. the line and character position is displayed at the bottom of the editor window. A box is NOT drawn around the text window.
It is added to an Interact object, and when activated captures key presses.
use Term::Graille qw/colour paint printAt cursorAt clearScreen border blockBlit block2braille pixelAt/;
use Term::Graille::Interact ;
use Term::Graille::Textarea;
my $io=Term::Graille::Interact->new(); # create an Interact object
$io->{debugCursor}=[22,45]; # optional, reports key presses
my $textarea=new Term::Graille::Textarea(%params);
my $objId=$io->addObject(object => $textarea,trigger=>"e");
# adding an object returns an Id, but the id can be set
# the trigger is the key than is used to activate the textarea widget
$io->start($objId);
$io->run($objId); # if the object id is passed the object is active immediately
The optional parameters are: -
- geometry (width and height) can be passed as an ArrayRef, default [72,14]
- position (row column) default [4,6]