SDLx::Widget::Textbox - create text boxes for your SDL apps easily
Create a simple SDL text for your SDLx::App:
$textbox = SDLx::Widget::Textbox->new(app => $app, x => 200, y => 200, w => 200, h => 20, name => 'username'); $passbox = SDLx::Widget::Textbox->new(app => $app, x => 200, y => 230, w => 200, h => 20, name => 'password', password => 1); $textbox->show; $passbox->show;
$app is SDLx::App or SDLx::Controller.
$app
Get the value out by:
my $text_value = $textbox->value;
Also know if it is focused right now.
warn 'Stop typing here!' if $textbox->focus;
SDL, SDLx::App, SDLx::Controller
To install SDLx::Widget, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SDLx::Widget
CPAN shell
perl -MCPAN -e shell install SDLx::Widget
For more information on module installation, please visit the detailed CPAN module installation guide.