insch, mvinsch, mvwinsch, or winsch Subroutine

Purpose

Inserts a single-byte character and rendition in a window.

Library

Curses Library (libcurses.a)

Syntax

#include <curses.h>
int insch(chtype ch);
int mvinsch(int y,
chtype h); 

int mvwinsch(WINDOW  *win,
int x,
int y,
chtype h);

int winsch(WINDOW *win,
chtype h); 

Description

These subroutines insert the character and rendition into the current or specified window at the current or specified position.

These subroutines do not perform wrapping or advance the cursor position. These functions perform special-character processing, with the exception that if a newline is inserted into the last line of a window and scrolling is not enabled, the behavior is unspecified.

Parameters

Item Description
ch  
y  
x  
*win Specifies the window in which to insert the character.

Return Values

Upon successful completion, these subroutines return OK. Otherwise, they return ERR.

Examples

  1. To insert the character x in the stdscr, enter:
    chtype x;
    insch(x);
  2. To insert the character x into the user-defined window my_window, enter:
    WINDOW *my_window
    chtype x;
    winsch(my_window, x);
  3. To move the logical cursor to the coordinates Y=10, X=5 prior to inserting the character x in the stdscr, enter:
    chtype x;
    mvinsch(10, 5, x);
  4. To move the logical cursor to the coordinates y=10, X=5 prior to inserting the character x in the user-defined window my_window, enter:
    WINDOW *my_window;
    chtype x;
    mvwinsch(my_window, 10, 5, x);