module Newt:sig
..end
exception NewtFailure of string
typecolor_set =
Newt_int.newtColorSet
typecolors =
Newt_int.newtColors
typeflags_sense =
Newt_int.newtFlagsSense
type
flag =
| |
RETURNEXIT |
| |
HIDDEN |
| |
SCROLL |
| |
DISABLED |
| |
BORDER |
| |
WRAP |
| |
NOF12 |
| |
MULTIPLE |
| |
SELECTED |
| |
CHECKBOX |
| |
PASSWORD |
| |
SHOWCURSOR |
type
fd_flag =
| |
FD_READ |
| |
FD_WRITE |
| |
FD_EXCEPT |
val init : unit -> unit
val finished : unit -> unit
val init_and_finish : (unit -> 'a) -> 'a
init_and_finish f
calls Newt.init
, then runs the function f ()
,
then finishes (cleans up) the terminal.
It does the right thing even if f
throws an exception.
val cls : unit -> unit
val resize_screen : int -> unit
val wait_for_key : unit -> unit
val clear_key_buffer : unit -> unit
val delay : int -> unit
val open_window : int -> int -> int -> int -> string -> unit
val centered_window : int -> int -> string -> unit
val pop_window : unit -> unit
val pop_window_no_refresh : unit -> unit
val set_colors : Newt_int.newtColors -> unit
val set_color : Newt_int.newtColorSet -> string -> string -> unit
val refresh : unit -> unit
val suspend : unit -> unit
val resume : unit -> int
val push_help_line : string -> unit
val redraw_help_line : unit -> unit
val pop_help_line : unit -> unit
val draw_root_text : int -> int -> string -> unit
val bell : unit -> unit
val cursor_on : unit -> unit
val cursor_off : unit -> unit
val get_screen_size : unit -> int * int
type'a
component =Newt._component
type
_component
type
component_ptr
val component_equals : component_ptr -> [> `Component ] component -> bool
int -> int -> string -> [ `Button | `Component ] component
: int -> int -> string -> [ `Button | `Component ] component
: val checkbox : int ->
int ->
string -> char -> string option -> [ `Checkbox | `Component ] component
val checkbox_get_value : [> `Checkbox ] component -> char
val checkbox_set_value : [> `Checkbox ] component -> char -> unit
val checkbox_set_flags : [> `Checkbox ] component ->
flag list -> Newt_int.newtFlagsSense -> unit
int ->
int ->
string ->
bool ->
[> `Radio ] component option -> [ `Component | `Radio ] component
: val radio_get_current : [> `Radio ] component -> component_ptr
val label : int -> int -> string -> [ `Component | `Label ] component
val label_set_text : [> `Label ] component -> string -> unit
val vertical_scrollbar : int ->
int ->
int ->
color_set ->
color_set -> [ `Component | `VerticalScrollbar ] component
val scrollbar_set : [> `VerticalScrollbar ] component -> int -> int -> unit
type 'a
listbox
val listbox : int -> int -> int -> flag list -> 'a listbox
val listbox_get_current : 'a listbox -> 'a option
data
field from the current item, for listboxes
which only allow single selection.
If nothing is selected, None
is returned.
val listbox_set_current : 'a listbox -> int -> unit
val listbox_set_current_by_key : 'a listbox -> 'a -> unit
data
.Not_found
if data is not found.val listbox_set_entry : 'a listbox -> int -> string -> unit
val listbox_set_width : 'a listbox -> int -> unit
val listbox_set_data : 'a listbox -> int -> 'a -> unit
val listbox_append_entry : 'a listbox -> string -> 'a -> unit
listbox_append_entry lb text data
appends a new listbox
entry consisting of the text string text
and data data
to the end of the listbox.val listbox_insert_entry : 'a listbox -> string -> 'a -> 'a option -> unit
listbox_insert_entry lb text data after
inserts a new listbox
entry consisting of the text string text
and data data
after the current listbox entry with data field after
.
It returns the position of the new entry.Not_found
if after
is not found.val listbox_delete_entry : 'a listbox -> 'a -> unit
listbox_delete_entry lb data
deletes the listbox entry
which contains data
.Not_found
if data
is not found.val listbox_clear : 'a listbox -> unit
val listbox_get_entry : 'a listbox -> int -> string * 'a
val listbox_get_selection : 'a listbox -> 'a array
listbox_get_selection lb
return an array of
data
from the items selected.val listbox_clear_selection : 'a listbox -> unit
val listbox_select_item : 'a listbox -> 'a -> flags_sense -> unit
data
.Not_found
if data is not found.val listbox_item_count : 'a listbox -> int
val component_of_listbox : 'a listbox -> [ `Component | `Listbox ] component
val textbox_reflowed : int ->
int ->
string ->
int ->
int -> int -> flag list -> [ `Component | `Textbox ] component
val textbox : int ->
int ->
int -> int -> flag list -> [ `Component | `Textbox ] component
val textbox_set_text : [> `Textbox ] component -> string -> unit
val textbox_set_height : [> `Textbox ] component -> int -> unit
val textbox_get_num_lines : [> `Textbox ] component -> int
val reflow_text : string -> int -> int -> int -> string * int * int
val entry : int ->
int ->
string option ->
int -> flag list -> [ `Component | `Entry ] component
val entry_set : [> `Entry ] component -> string -> bool -> unit
val entry_get_value : [> `Entry ] component -> string
val entry_set_flags : [> `Entry ] component -> flag list -> flags_sense -> unit
val scale : int -> int -> int -> int64 -> [ `Component | `Scale ] component
val scale_set : [> `Scale ] component -> int64 -> unit
val form : [> `VerticalScrollbar ] component option ->
string option -> flag list -> [ `Component | `Form ] component
val form_set_timer : [> `Form ] component -> int -> unit
val form_watch_fd : [> `Form ] component -> Unix.file_descr -> fd_flag list -> unit
val form_set_size : [> `Form ] component -> unit
val form_get_current : [> `Form ] component -> component_ptr
val form_set_background : [> `Form ] component -> int -> unit
val form_set_current : [> `Form ] component -> [> `Component ] component -> unit
val form_add_component : [> `Form ] component -> [> `Component ] component -> unit
val form_add_components : [> `Form ] component -> [> `Component ] component list -> unit
val form_set_height : [> `Form ] component -> int -> unit
val form_set_width : [> `Form ] component -> int -> unit
val run_form : [> `Form ] component -> component_ptr option
val form_run : [> `Form ] component -> Newt_int.newtExitStruct
val form_add_hot_key : [> `Form ] component -> int -> unit
val component_takes_focus : [> `Component ] component -> bool -> unit
component_takes_focus co bool
enables or disables
a component.val component_add_callback : [> `Component ] component -> (unit -> unit) -> unit
component_add_callback co f
adds a general callback function f
to a component. This is only available for certain types
of component -- see the Newt documentation for more information.