Class curses.chstr
Curses attributed string buffers.
An array of characters, plus associated curses attributes and colors at each position.
Although marginally useful alone, the constants used to set colors
and attributes in chstr buffers are not defined until after
curses.initscr () has been called.
Methods
| curses.chstr:dup () | Duplicate chstr. | 
| curses.chstr:get (o) | Get information from the chstr. | 
| curses.chstr:len (cs) | Retrieve chstr length. | 
| curses.chstr:set_ch (o, int[, attr=A_NORMAL[, rep=1]]) | Set a character in the buffer. | 
| curses.chstr:set_str (o, s[, attr=A_NORMAL[, rep=1]]) | Change the contents of the chstr. | 
Metamethods
| curses.chstr:__call (len) | Initialise a new chstr. | 
Methods
- curses.chstr:dup ()
- 
    Duplicate chstr.
    Returns:- 
           chstr
        duplicate of cs
    
 Usage:dup = cs:dup () 
- curses.chstr:get (o)
- 
    Get information from the chstr.
    Parameters:- o int offset from start of cs
 Returns:- int character at offset o in cs
- int bitwise-OR of attributes at offset o in cs
- int colorpair at offset o in cs
 Usage:cs = curses.chstr (10) cs:set_ch(0, 'A', curses.A_BOLD, 10) --> 65 2097152 0 print (cs:get (9)) 
- curses.chstr:len (cs)
- 
    Retrieve chstr length.
    Parameters:- cs chstr buffer to act on
 Returns:- 
           int
        length of cs
    
 Usage:cs = curses.chstr (123) --> 123 print (cs:len ()) 
- curses.chstr:set_ch (o, int[, attr=A_NORMAL[, rep=1]])
- 
    Set a character in the buffer.
ch* can be a one-character string, or an integer from string.byteParameters:- o int offset to start of change
- int |string ch character to insert
- attr int attributes for changed elements (default A_NORMAL)
- rep int repeat count (default 1)
 Usage:-- Write a bold 'A' followed by normal 'a' chars to a new buffer size = 10 cs = curses.chstr (size) cs:set_ch(0, 'A', curses.A_BOLD) cs:set_ch(1, 'a', curses.A_NORMAL, size - 1) 
- curses.chstr:set_str (o, s[, attr=A_NORMAL[, rep=1]])
- 
    Change the contents of the chstr.
    Parameters:- o int offset to start of change
- s string characters to insert into cs at o
- attr int attributes for changed elements (default A_NORMAL)
- rep int repeat count (default 1)
 Usage:cs = curses.chstr (10) cs:set_str(0, "0123456789", curses.A_BOLD) 
Metamethods
- curses.chstr:__call (len)
- 
    Initialise a new chstr.
    Parameters:- len int buffer length
 Returns:- 
           chstr
        a new chstr filled with spaces
    
 Usage:cs = curses.chstr (10)