|
|
MPE/iX Developer's Kit Reference Manual Volume 2: HP 3000 MPE/iX Computer Systems > Chapter 4 CURSESaddch waddch mvaddch mvwaddch |
|
The addch set of routines is used to add a character (with attributes) to a window.
A window is made up of foreground and background attributes. All characters except space are part of the foreground. The character and its attributes make up a character/attribute pair defined as a chtype. The character is any 16-bit value; the attribute consists of highlighting attributes that affect the appearance of the character on the screen (for example, bold, underline). Each time that a character, other than a space, is written to a window with waddch(), wprintw(), or waddstr(), a bitwise OR operation is performed between the chtype (foreground character with its attributes), the current foreground attributes of the window, and the current background attributes of the window. The current foreground attributes are set with the wattrset(), wattron(), and wattroff() routines; the current background attributes are set with the wbgdset() routine. When spaces are written to the screen, the background character and attributes replace the space. For example, if the background attribute and character is
text written to the window appears underlined, and the spaces appear as underlined asterisks. After the OR operation, each character written retains the new foreground and background attributes that it has obtained. This allows the character to be copied as is to a window with the waddchstr() or insch() routines. The addch() routine writes a character to the stdscr window at the current cursor position and advances the cursor. The waddch() routine performs an identical action, but writes the character to the window specified by win. The mvaddch() and mvwaddch() routines write the character to the position indicated by the x (column) and y (row) parameters. The mvaddch() routine writes the character to the stdscr window, while mvwaddch() writes the character to the window specified by win. If the character is a newline, carriage return, backspace, or tab, the cursor is moved appropriately. The cursor is moved to the next tab stop for each tab character (tab stops are eight characters apart). If the character is a control character other than those previously mentioned, the character is written using ^x notation, where x is a printable character. If the character is written to the last character position on a line, a newline is generated automatically. If the character is written to the last character position of a scrolling region and scrollok() is enabled, the scrolling region is scrolled up one line (see wsetscrreg()). Individual characters can be highlighted by performing a bitwise OR operation between the character and one or more of the constants shown in Table 4-2 “Constant Values for Highlighting Attributes”. Table 4-2 Constant Values for Highlighting Attributes
The characters shown in Table 4-3 “Constant Values for Characters” are defined as constants in CURSES. Table 4-3 Constant Values for Characters
winsch(), nl(), nonl(), scrollok(), wattron(), wattroff(), wattrset(), wbkgdset(), wprintw(), wscrl(), wsetscrreg() |
|