NAME
LibUI::NonWrappingMultilineEntry - Multiline Text Entry Field That Does Not Automatically Wrap
SYNOPSIS
use LibUI ':all';
use LibUI::VBox;
use LibUI::Window;
use LibUI::NonWrappingMultilineEntry;
Init && die;
my $window = LibUI::Window->new( 'Notepadish', 320, 100, 0 );
$window->setMargined( 1 );
my $box = LibUI::VBox->new();
my $text = LibUI::NonWrappingMultilineEntry->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();
DESCRIPTION
A control with a multi line text entry field that scrolls horizontally when lines overflow.
Functions
Not a lot here but... well, it's just a simple widget.
new( )
my $text = LibUI::NonWrappingMultilineEntry->new( );
Creates a new multi line entry that does not wrap text on 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
- CodeRef that should expect the following:$data
- user data to be passed to the callback
Note: The callback is not triggered when calling setText( ... )
or append( ... )
.
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.
See Also
LibUI::Entry - Single line text field
LibUI::MultilineEntry - Multi-line text file that wraps
LICENSE
Copyright (C) Sanko Robinson.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
Sanko Robinson <sanko@cpan.org>