Next: , Previous: Window Manipulation, Up: Curses


5.12.4 Output

These routines are used to draw text on windows

— Function: display ch win
— Function: display str win
— Function: wadd win ch
— Function: wadd win str

The character ch or characters in str are put into the window win at the current cursor position of the window and the position of win's cursor is advanced. At the right margin, an automatic newline is performed. At the bottom of the scrolling region, if scrollok is enabled, the scrolling region will be scrolled up one line.

If ch is a <TAB>, <LFD>, or backspace, the cursor will be moved appropriately within the window win. A <LFD> also does a wclrtoeol before moving. <TAB> characters are considered to be at every eighth column. If ch is another control character, it will be drawn in the C-x notation. (Calling winch after adding a control character will not return the control character, but instead will return the representation of the control character.)

Video attributes can be combined with a character by or-ing them into the parameter. This will result in these attributes also being set. The intent here is that text, including attributes, can be copied from one place to another using inch and display. See standout, below.

Note For wadd ch can be an integer and will insert the character of the corresponding value.

— Function: werase win

This routine copies blanks to every position in the window win.

— Function: wclear win

This routine is like werase, but it also calls clearok, arranging that the screen will be cleared completely on the next call to refresh or force-output for window win, and repainted from scratch.

— Function: wclrtobot win

All lines below the cursor in window win are erased. Also, the current line to the right of the cursor, inclusive, is erased.

— Function: wclrtoeol win

The current line to the right of the cursor, inclusive, is erased.

— Function: wdelch win

The character under the cursor in the window win is deleted. All characters to the right on the same line are moved to the left one position and the last character on the line is filled with a blank. The cursor position does not change. This does not imply use of the hardware “delete-character” feature.

— Function: wdeleteln win

The line under the cursor in the window win is deleted. All lines below the current line are moved up one line. The bottom line win is cleared. The cursor position does not change. This does not imply use of the hardware “deleteline” feature.

— Function: winsch win ch

The character ch is inserted before the character under the cursor. All characters to the right are moved one <SPC> to the right, possibly losing the rightmost character of the line. The cursor position does not change . This does not imply use of the hardware “insertcharacter” feature.

— Function: winsertln win

A blank line is inserted above the current line and the bottom line is lost. This does not imply use of the hardware “insert-line” feature.

— Function: scroll win

The window win is scrolled up one line. This involves moving the lines in win's data structure. As an optimization, if win is stdscr and the scrolling region is the entire window, the physical screen will be scrolled at the same time.