Library
Module
Module type
Parameter
Class
Class type
* Bindings to the ncurses library. * * Beware, all coordinates are passed y
first, then x
. * * Functions whose name start with a "w" take as first argument the window the * function applies to. * Functions whose name start with "mv" take as first two arguments the * coordinates y
and x
of the point to move the cursor to. For example * mvaddch y x ch
is the same as move y x; addch ch
.
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.
val initscr : unit -> window
Initialize the curses library.
val newterm : string -> Unix.file_descr -> Unix.file_descr -> screen
Create a new terminal.
val set_term : screen -> unit
Switch terminal.
val delscreen : screen -> unit
Delete a screen.
val stdscr : unit -> window
val getyx : window -> int * int
Get the current cursor position.
val getparyx : window -> int * int
val getbegyx : window -> int * int
val getmaxyx : window -> int * int
val move : int -> int -> err
Move the cursor.
module Acs : sig ... end
Predefined characters.
val get_acs_codes : unit -> Acs.acs
Get the predefined characters.
Add a sequence of characters at the current position. See also addstr
.
val addstr : string -> err
Add a string at the current position.
val mvaddstr : int -> int -> string -> err
val addnstr : string -> int -> int -> err
val mvaddnstr : int -> int -> string -> int -> int -> err
val insstr : string -> err
Insert a string before cursor.
val mvinsstr : int -> int -> string -> err
val insnstr : string -> int -> int -> err
val mvinsnstr : int -> int -> string -> int -> int -> err
val delch : unit -> err
Delete a character.
val mvdelch : int -> int -> err
module A : sig ... end
Attributes.
module WA : sig ... end
New series of highlight attributes.
val wattroff : window -> int -> unit
val wattron : window -> int -> unit
val wattrset : window -> int -> unit
val wstandend : window -> unit
val wstandout : window -> unit
val attr_off : attr_t -> unit
Turn off the attributes given in argument (see the WA
module).
val attr_on : attr_t -> unit
val attr_set : attr_t -> int -> unit
val chgat : int -> attr_t -> int -> unit
chgat n attr color
changes the attributes of n
characters.
val mvchgat : int -> int -> int -> attr_t -> int -> unit
val inch : unit -> chtype
Get the attributes of the caracter at current position.
val mvinch : int -> int -> chtype
val instr : string -> err
Get the attributes of a string.
val mvinstr : int -> int -> string -> err
val innstr : string -> int -> int -> err
val mvinnstr : int -> int -> string -> int -> int -> err
val bkgdset : chtype -> unit
Set the background of the current character.
val bkgd : chtype -> unit
Set the background of every character.
val deleteln : unit -> err
Delete a line.
val insdelln : int -> err
insdelln n
inserts n
lines above the current line if n
is positive or * deletes -n
lines if n
is negative.
val insertln : unit -> err
Insert a blank line above the current line.
module Key : sig ... end
Special keys.
val wgetch : window -> int
val mvwgetch : window -> int -> int -> int
val ungetch : int -> err
val getstr : string -> err
Read a string in a window.
val mvgetstr : int -> int -> string -> err
val getnstr : string -> int -> int -> err
val mvgetnstr : int -> int -> string -> int -> int -> err
val newwin : int -> int -> int -> int -> window
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.
val wsyncup : window -> unit
If syncok
is called with true
as second argument, wsyncup
is called * automatically whenever there is a change in the window.
val wcursyncup : window -> unit
val wsyncdown : window -> unit
val null_window : window
val refresh : unit -> err
Refresh windows.
val doupdate : unit -> err
val resizeterm : int -> int -> err
val scrl : int -> err
val is_linetouched : window -> int -> int
val is_wintouched : window -> bool
val werase : window -> unit
val wclear : window -> unit
val wclrtobot : window -> unit
val wclrtoeol : window -> unit
Draw a box around the edges of a window.
val hline : chtype -> int -> unit
Draw an horizontal line.
val mvhline : int -> int -> chtype -> int -> unit
val vline : chtype -> int -> unit
Draw a vertical line.
val mvvline : int -> int -> chtype -> int -> unit
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.
val newpad : int -> int -> window
Create a new pad.
module Color : sig ... end
Colors.
val start_color : unit -> err
val use_default_colors : unit -> err
val init_pair : int -> int -> int -> err
val init_color : int -> int -> int -> int -> err
val cbreak : unit -> err
Disable line buffering.
val halfdelay : int -> err
Similar to cbreak
but with delay.
val nocbreak : unit -> err
Enable line buffering (waits for characters until newline is typed).
val echo : unit -> err
Don't echo typed characters.
val noecho : unit -> err
Echo typed characters.
val raw : unit -> err
val noraw : unit -> err
val wtimeout : window -> int -> unit
val typeahead : Unix.file_descr -> err
val notypeahead : unit -> err
val clearok : window -> bool -> 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.
val idlok : window -> bool -> unit
val idcok : window -> bool -> unit
val immedok : window -> bool -> unit
val leaveok : window -> bool -> unit
val setscrreg : int -> int -> err
val scrollok : window -> bool -> unit
val slk_init : int -> err
Initialize soft labels.
val slk_set : int -> string -> int -> err
val slk_refresh : unit -> err
val slk_noutrefresh : unit -> err
val slk_clear : unit -> err
val slk_restore : unit -> err
val slk_touch : unit -> err
val beep : unit -> err
Ring a bell.
val flash : unit -> err
Flash the screen.
val unctrl : chtype -> string
val getwin : Unix.file_descr -> window
val delay_output : int -> err
val scr_dump : string -> err
Dump the current screen to a file.
val scr_restore : string -> err
val scr_init : string -> err
val scr_set : string -> err
val termattrs : unit -> attr_t
val setupterm : string -> Unix.file_descr -> err
val setterm : string -> err
val cur_term : unit -> terminal
val restartterm : string -> Unix.file_descr -> err
val putp : string -> err
val mvcur : int -> int -> int -> int -> err
val tputs : string -> int -> (char -> unit) -> err
Save the current terminal modes as the "program" state for use by the * reser_prog_mod
and reset_shell_mode
functions.
val curs_set : int -> err
val get_ripoff : unit -> window * int
module Curses_config : sig ... end