LibUI::MultilineEntry - Multiline Text Entry Field
use LibUI ':all'; use LibUI::VBox; use LibUI::Window; use LibUI::MultilineEntry; Init( { Size => 1024 } ) && die; my $window = LibUI::Window->new( 'Notepadish', 320, 100, 0 ); my $box = LibUI::VBox->new(); my $text = LibUI::MultilineEntry->new(); $box->append( $text, 1 ); $text->onChanged( sub { warn sprintf '%d chars', length shift->text; }, undef ); $window->setChild($box); $window->onClosing( sub { Quit(); return 1; }, undef ); $window->show; Main();
A control with a multi line text entry field.
Not a lot here but... well, it's just a simple widget.
new( )
my $text = LibUI::MultilineEntry->new( );
Creates a new multi line entry that visually wraps text when lines overflow.
append( ... )
$text->append(qq[-- \nJohn Smith\nsmithj\@work.email]);
Appends text to the multi line entry's text.
onChanged( ... )
$date->onChanged( sub { my ($ctrl, $data) = @_; warn $ctrl->text; }, undef);
Registers a callback for when the user changes the multi line entry's text.
Expected parameters include:
$callback
$date
$data
Note: The callback is not triggered when calling setText( ... ) or append( ... ).
setText( ... )
readonly( )
if( $text->readonly ) { ...; }
Returns whether or not the multi line entry's text can be changed.
setReadonly( ... )
$text->setReadonly( 1 );
Sets whether or not the multi line entry's text is read only.
text( )
warn $date->text;
Returns the multi line entry's text.
setTime( ... )
$date->setTime( 'We need to get to work.' );
Sets the multi line entry's text.
LibUI::Entry - Single line text field
LibUI::NonWrappingMultilineEntry - Multi-line text file that does not wrap
Copyright (C) Sanko Robinson.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Sanko Robinson <sanko@cpan.org>
To install LibUI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm LibUI
CPAN shell
perl -MCPAN -e shell install LibUI
For more information on module installation, please visit the detailed CPAN module installation guide.