Warfy has asked for the wisdom of the Perl Monks concerning the following question:
This is how I thought it should be:
use Curses; use Curses::Widgets; use Curses::Widgets::TextField; # Initialise the environment $mwh = new Curses; noecho(); halfdelay(5); $mwh->keypad(0); curs_set(0); $tf = Curses::Widgets::TextField->new({ CAPTION => 'login', CAPTIONCOL => 'yellow', COLUMNS => 10, MAXLENGTH => 255, #MASK => undef, VALUE => '', INPUTFUNC => \&scankey, FOREGROUND => 'black', BACKGROUND => 'green', BORDER => 1, BORDERCOL => 'red', FOCUSSWITCH => "\t\n", CURSORPOS => 0, TEXTSTART => 0, PASSWORD => 0, X => 1, Y => 1, READONLY => 0, }); $tf->draw($mwh, 0); $tf->execute($mwh); $login = $tf->getField('VALUE'); { END { endwin(); } exit 0; sub login { if ($login = ~ /test\b/) { # Do something } }
edited by ybiC: Replace <pre> tags with <code>, as per Monastery convention
Any sugestions would be very helpfull because I'm stuck and as you can see I'm quite new into perl programming.
Thank you for your time reading it.
Title edit by tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: curses::widgets
by Zaxo (Archbishop) on Aug 25, 2003 at 23:09 UTC |