Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  CURSES::UI::COMMON (3)

.ds Aq ’


Curses::UI::Common - Common methods for Curses::UI



 Curses::UI::Common - base class


    package MyPackage;

    use Curses::UI::Common;
    use vars qw(@ISA);
    @ISA = qw(Curses::UI::Common);


Curses::UI::Common is a collection of methods that is shared between Curses::UI classes.


    Various methods

o <B>parentB> ( )

Returns the data member $this->{<B>-parentB>}.

o <B>rootB> ( )

Returns the topmost <B>-parentB> (the Curses::UI instance).

o <B>delallwinB> ( )

This method will walk through all the data members of the class intance. Each data member that is a Curses::Window descendant will be removed.

o <B>accessorB> ( NAME, [VALUE] )

If VALUE is set, the value for the data member $this->{NAME} will be changed. The method will return the current value for data member $this->{NAME}.

o <B>keys_to_lowercaseB> ( HASHREF )

All keys in the hash referred to by HASHREF will be converted to lower case.

    Text processing

<B>split_to_linesB> ( TEXT ) This method will split TEXT into a list of separate lines. It returns a reference to this list.
<B>scrlengthB> ( LINE ) Returns the screenlength of the string LINE. The difference with the perl function length() is that this method will expand TAB characters. It is exported by this class and it may be called as a stand-alone routine.
<B>text_dimensionB> ( TEXT ) This method will return an array containing the width (the length of the longest line) and the height (the number of lines) of the TEXT.
<B>text_wrapB> ( LINE, LENGTH, WORDWRAP )
<B>NO_WORDWRAPB> ( ) This method will wrap a line of text (LINE) to a given length (LENGTH). If the WORDWRAP argument is true, wordwrap will be enabled (this is the default for WORDWRAP). It will return a reference to a list of wrapped lines. It is exported by this class and it may be called as a stand-alone routine.

The <B>WORDWRAPB> and <B>NO_WORDWRAPB> routines will return the correct value vor the WORDWRAP argument. These routines are exported by this class.


    $this->text_wrap($line, 50, NO_WORDWRAP);

    Reading key input

<B>CUI_TABB> ( )
<B>CUI_SPACEB> ( ) These are a couple of routines that are not defined by the Curses module, but which might be useful anyway. These routines are exported by this class.
<B>get_keyB> ( BLOCKTIME, CURSOR ) This method will try to read a key from the keyboard. It will return the key pressed or -1 if no key was pressed. It is exported by this class and it may be called as a stand-alone routine.

The BLOCKTIME argument can be used to set the curses halfdelay (the time to wait before the routine decides that no key was pressed). BLOCKTIME is given in tenths of seconds. The default is 0 (non-blocking key read).


    my $key = $this->get_key(5)




Copyright (c) 2001-2002 Maurice Makaay. All rights reserved.

Maintained by Marcus Thiesen (

This package is free software and is provided as is without express or implied warranty. It may be used, redistributed and/or modified under the same terms as perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 CURSES::UI::COMMON (3) 2011-09-01

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.