Term::Stool::Button
Term::Stool::InUser3Contributed Perl DocumenTerm::Stool::Input(t)



NAME
       Term::Stool::Button - text input widget

DESCRIPTION
       This is a text input widget.

       Term::Stool::Widget is the parent of this class.

FIELDS
       text
           The contents of the widget.

       cursor
           The location of the cursor within the text.

       scrollpos
           This holds the left-most visible character's location
           within the text.

       validate_hook
           Points to a method that is called before each change
           to the text. The method is passed the proposed new
           text, and can do any type of checks to validate it. It
           should return true if the new text is ok, false other-
           wise.  Two simple methods suitable for use as vali-
           date_hooks are defined below.

METHODS
       noscroll_validate_hook
           Returns a validate_hook method that limits the length
           of input text to the width of the input widget.

           Turn it on like this:
            $input->validate_hook($input->noscroll_vali-
           date_hook);

       integer_validate_hook
           Returns a validate_hook method that only allows inte-
           gers to be input.

           Turn it on like this:
            $input->validate_hook($input->noscroll_vali-
           date_hook);

       init
           Comes up with useful defaults for most of the fields.

       display
           Draws the widget.

       resize
           When resized to be smaller, make sure that the scroll-
           pos still makes sense.

           Also try to move the scrollpos left if resized to be
           bigger, so as much of the text as possible is dispo-
           layed.

       keypress
           Most keys are treated as input. Also, delete,
           backspace, arrow keys, and ctrl-k are handled.

AUTHOR
       Joey Hess <joey@kitenet.net>



2001-05-23                 perl v5.6.1      Term::Stool::Input(t)