Characters. Usual characters can be converted from/to chtype using * char_of_int and int_of_char. See also get_acs_codes for characters * useful for drawing and the Key module for special input characters.
Attributes are lorings of flags which are defined in the A module.
A return value. false means that an error occured.
Initialization functions
Initialize the curses library.
Sourceval endwin : unit -> unit Restore the terminal (should be called before exiting).
Sourceval isendwin : unit -> bool Has endwin been called without any subsequent call to werefresh?
Sourceval newterm : string -> Unix.file_descr -> Unix.file_descr -> screen Get the current cursor position.
Operations on characters
Get the predefined characters.
Add a character at the current position, then advance the cursor.
echochar ch is equivalent to addch ch followed by refresh ().
Add a sequence of characters at the current position. See also addstr.
Add a string at the current position.
Sourceval mvaddstr : int -> int -> string -> err Sourceval addnstr : string -> int -> int -> err Sourceval mvaddnstr : int -> int -> string -> int -> int -> err Insert a character before cursor.
Insert a string before cursor.
Sourceval mvinsstr : int -> int -> string -> err Sourceval insnstr : string -> int -> int -> err Sourceval mvinsnstr : int -> int -> string -> int -> int -> err New series of highlight attributes.
Sourceval attroff : int -> unit Turn off the attributes given in argument (see the A module).
Sourceval attron : int -> unit Turn on the attributes given in argument.
Sourceval attrset : int -> unit Sourceval standend : unit -> unit Sourceval standout : unit -> unit Turn off the attributes given in argument (see the WA module).
chgat n attr color changes the attributes of n characters.
Sourceval mvchgat : int -> int -> int -> attr_t -> int -> unit Get the attributes of the caracter at current position.
Get the attributes of a sequence of characters.
Get the attributes of a string.
Sourceval mvinstr : int -> int -> string -> err Sourceval innstr : string -> int -> int -> err Sourceval mvinnstr : int -> int -> string -> int -> int -> err Background
Set the background of the current character.
Set the background of every character.
Get the current background.
Operations on lines
insdelln n inserts n lines above the current line if n is positive or * deletes -n lines if n is negative.
Insert a blank line above the current line.
Read a character in a window.
Sourceval mvgetch : int -> int -> int Read a string in a window.
Sourceval mvgetstr : int -> int -> string -> err Sourceval getnstr : string -> int -> int -> err Sourceval mvgetnstr : int -> int -> string -> int -> int -> err Windows
Window manipulations
newwin l c y x create a new window with l lines, c columns. The upper * left-hand corner is at (x,y).
subwin l c y x create a subwindow with l lines and c columns at * screen-relative position (x,y).
Same as subwin excepting that the position (x,y) is relative to the * parent window.
If syncok is called with true as second argument, wsyncup is called * automatically whenever there is a change in the window.
Sourceval winch_handler_on : unit -> unit Sourceval winch_handler_off : unit -> unit Sourceval get_size : unit -> int * int Sourceval get_size_fd : Unix.file_descr -> int * int Sourceval erase : unit -> unit Sourceval clear : unit -> unit Sourceval clrtobot : unit -> unit Sourceval clrtoeol : unit -> unit overlay srcwin dstwin overlays srcwin on top of dstwin.
Decorations
Draw a box around the edges of a window.
Pads
A pad is like a window except that it is not restricted by the screen size, * and is not necessarily associated with a particular part of the screen.
Sourceval prefresh : window -> int -> int -> int -> int -> int -> int -> err Sourceval pnoutrefresh : window -> int -> int -> int -> int -> int -> int -> err Colors
Sourceval init_pair : int -> int -> int -> err Sourceval init_color : int -> int -> int -> int -> err Sourceval has_colors : unit -> bool Sourceval can_change_color : unit -> bool Sourceval color_content : int -> int * int * int Sourceval pair_content : int -> int * int Sourceval colors : unit -> int Sourceval color_pairs : unit -> int Similar to cbreak but with delay.
Enable line buffering (waits for characters until newline is typed).
Don't echo typed characters.
Sourceval noqiflush : unit -> unit Sourceval qiflush : unit -> unit Sourceval timeout : int -> unit If called with true as second argument, the next call to wrefresh with * this window will clear the streen completely and redraw the entire screen * from scratch.
Soft-label keys
Sourceval slk_set : int -> string -> int -> err Sourceval slk_label : int -> string Sourceval mousemask : int -> int * int Misc
Sourceval keyname : int -> string Sourceval filter : unit -> unit Sourceval use_env : bool -> unit Sourceval flushinp : unit -> unit Dump the current screen to a file.
Terminal
Sourceval baudrate : unit -> int Get the speed of a terminal (in bits per second).
Sourceval erasechar : unit -> char Get user's current erase character.
Sourceval has_ic : unit -> bool Has the terminal insert- and delete-character capabilites?
Sourceval has_il : unit -> bool Has the terminal insert- and delete-line capabilites?
Sourceval killchar : unit -> char Get user's current line kill character.
Sourceval longname : unit -> string Get a description of the terminal.
Sourceval termname : unit -> string Sourceval tgetent : string -> bool Sourceval tgetflag : string -> bool Sourceval tgetnum : string -> int Sourceval tgetstr : string -> bool Sourceval tgoto : string -> int -> int -> string Sourceval setupterm : string -> Unix.file_descr -> err Sourceval restartterm : string -> Unix.file_descr -> err Sourceval mvcur : int -> int -> int -> int -> err Sourceval tigetflag : string -> bool Sourceval tigetnum : string -> int Sourceval tigetstr : string -> string Sourceval tputs : string -> int -> (char -> unit) -> err Sourceval tparm : string -> int array -> string Sourceval bool_terminfo_variable : int -> string * string * string Sourceval num_terminfo_variable : int -> string * string * string Sourceval str_terminfo_variable : int -> string * string * string Sourceval def_prog_mode : unit -> unit Save the current terminal modes as the "program" state for use by the * reser_prog_mod and reset_shell_mode functions.
Sourceval def_shell_mode : unit -> unit Sourceval reset_prog_mode : unit -> unit Sourceval reset_shell_mode : unit -> unit Sourceval resetty : unit -> unit Sourceval savetty : unit -> unit Sourceval getsyx : unit -> int * int Sourceval setsyx : int -> int -> unit Sourceval ripoffline : bool -> unit Configuration