<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="next" href="Newt_int.html"> <link rel="Up" href="index.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of exceptions" rel=Appendix href="index_exceptions.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Newt" rel="Chapter" href="Newt.html"> <link title="Newt_int" rel="Chapter" href="Newt_int.html"><link title="Notes" rel="Section" href="#2_Notes"> <link title="Safety" rel="Section" href="#2_Safety"> <link title="Exceptions" rel="Section" href="#2_Exceptions"> <link title="Types" rel="Section" href="#2_Types"> <link title="Functions" rel="Section" href="#2_Functions"> <link title="Keys" rel="Section" href="#2_Keys"> <link title="Components" rel="Subsection" href="#3_Components"> <link title="Forms" rel="Subsection" href="#3_Forms"> <link title="Generic component functions" rel="Subsection" href="#3_Genericcomponentfunctions"> <title>Newt</title> </head> <body> <div class="navbar"> <a href="index.html">Up</a> <a href="Newt_int.html">Next</a> </div> <center><h1>Module <a href="type_Newt.html">Newt</a></h1></center> <br> <pre><span class="keyword">module</span> Newt: <code class="code">sig</code> <a href="Newt.html">..</a> <code class="code">end</code></pre>Interface to the newt text window system.<br> <hr width="100%"> <br> The newt windowing system is a terminal-based window and widget library designed for writing applications with a simple, but user-friendly, interface. While newt is not intended to provide the rich feature set advanced applications may require, it has proven to be flexible enough for a wide range of applications (most notably, Red Hat's installation process). <p> <span id="2_Notes"><h2>Notes</h2></span> <p> There is not a large amount of documentation for newt. The best documentation is probably Eric Troan's <a href="http://www.whoow.org/people/Jean-Marc.Lienher/gnewt/tutorial.html">newt tutorial</a>. <p> OCaml functions are derived using a predictable naming scheme. So for example the C function <code class="code">newtPopWindow</code> becomes <a href="Newt.html#VALpop_window"><code class="code">Newt.pop_window</code></a>. <p> There are plenty of OCaml examples in the <code class="code">examples/</code> subdirectory. <p> <span id="2_Safety"><h2>Safety</h2></span> <p> The OCaml bindings attempt to be as type and memory safe as possible. However newt itself makes this difficult. Newt code has many arbitrary limits, no checks on memory allocation, and inherent confusion about types. <p> Do not use functions from the unsafe <a href="Newt_int.html"><code class="code">Newt_int</code></a> (internal) module unless you know what you're doing.<br> <br> <span id="2_Exceptions"><h2>Exceptions</h2></span><br> <pre><span id="EXCEPTIONNewtFailure"><span class="keyword">exception</span> NewtFailure</span> <span class="keyword">of</span> <code class="type">string</code></pre> <br> <span id="2_Types"><h2>Types</h2></span><br> <pre><span id="TYPEcolor_set"><span class="keyword">type</span> <code class="type"></code>color_set</span> = <code class="type"><a href="Newt_int.html#TYPEnewtColorSet">Newt_int.newtColorSet</a></code> </pre> <pre><span id="TYPEcolors"><span class="keyword">type</span> <code class="type"></code>colors</span> = <code class="type"><a href="Newt_int.html#TYPEnewtColors">Newt_int.newtColors</a></code> </pre> <pre><span id="TYPEflags_sense"><span class="keyword">type</span> <code class="type"></code>flags_sense</span> = <code class="type"><a href="Newt_int.html#TYPEnewtFlagsSense">Newt_int.newtFlagsSense</a></code> </pre> <br><code><span id="TYPEflag"><span class="keyword">type</span> <code class="type"></code>flag</span> = </code><table class="typetable"> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">RETURNEXIT</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">HIDDEN</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">SCROLL</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">DISABLED</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">BORDER</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">WRAP</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">NOF12</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">MULTIPLE</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">SELECTED</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">CHECKBOX</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">PASSWORD</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">SHOWCURSOR</span></code></td> </tr></table> <br><code><span id="TYPEfd_flag"><span class="keyword">type</span> <code class="type"></code>fd_flag</span> = </code><table class="typetable"> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">FD_READ</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">FD_WRITE</span></code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">FD_EXCEPT</span></code></td> </tr></table> <br> <span id="2_Functions"><h2>Functions</h2></span><br> <pre><span id="VALinit"><span class="keyword">val</span> init</span> : <code class="type">unit -> unit</code></pre><pre><span id="VALfinished"><span class="keyword">val</span> finished</span> : <code class="type">unit -> unit</code></pre><pre><span id="VALinit_and_finish"><span class="keyword">val</span> init_and_finish</span> : <code class="type">(unit -> 'a) -> 'a</code></pre><div class="info"> <code class="code">init_and_finish f</code> calls <a href="Newt.html#VALinit"><code class="code">Newt.init</code></a>, then runs the function <code class="code">f ()</code>, then finishes (cleans up) the terminal. <p> It does the right thing even if <code class="code">f</code> throws an exception.<br> </div> <pre><span id="VALcls"><span class="keyword">val</span> cls</span> : <code class="type">unit -> unit</code></pre><pre><span id="VALresize_screen"><span class="keyword">val</span> resize_screen</span> : <code class="type">int -> unit</code></pre><pre><span id="VALwait_for_key"><span class="keyword">val</span> wait_for_key</span> : <code class="type">unit -> unit</code></pre><pre><span id="VALclear_key_buffer"><span class="keyword">val</span> clear_key_buffer</span> : <code class="type">unit -> unit</code></pre><pre><span id="VALdelay"><span class="keyword">val</span> delay</span> : <code class="type">int -> unit</code></pre><pre><span id="VALopen_window"><span class="keyword">val</span> open_window</span> : <code class="type">int -> int -> int -> int -> string -> unit</code></pre><pre><span id="VALcentered_window"><span class="keyword">val</span> centered_window</span> : <code class="type">int -> int -> string -> unit</code></pre><pre><span id="VALpop_window"><span class="keyword">val</span> pop_window</span> : <code class="type">unit -> unit</code></pre><pre><span id="VALpop_window_no_refresh"><span class="keyword">val</span> pop_window_no_refresh</span> : <code class="type">unit -> unit</code></pre><pre><span id="VALset_colors"><span class="keyword">val</span> set_colors</span> : <code class="type"><a href="Newt_int.html#TYPEnewtColors">Newt_int.newtColors</a> -> unit</code></pre><pre><span id="VALset_color"><span class="keyword">val</span> set_color</span> : <code class="type"><a href="Newt_int.html#TYPEnewtColorSet">Newt_int.newtColorSet</a> -> string -> string -> unit</code></pre><pre><span id="VALrefresh"><span class="keyword">val</span> refresh</span> : <code class="type">unit -> unit</code></pre><pre><span id="VALsuspend"><span class="keyword">val</span> suspend</span> : <code class="type">unit -> unit</code></pre><pre><span id="VALresume"><span class="keyword">val</span> resume</span> : <code class="type">unit -> int</code></pre><pre><span id="VALpush_help_line"><span class="keyword">val</span> push_help_line</span> : <code class="type">string -> unit</code></pre><pre><span id="VALredraw_help_line"><span class="keyword">val</span> redraw_help_line</span> : <code class="type">unit -> unit</code></pre><pre><span id="VALpop_help_line"><span class="keyword">val</span> pop_help_line</span> : <code class="type">unit -> unit</code></pre><pre><span id="VALdraw_root_text"><span class="keyword">val</span> draw_root_text</span> : <code class="type">int -> int -> string -> unit</code></pre><pre><span id="VALbell"><span class="keyword">val</span> bell</span> : <code class="type">unit -> unit</code></pre><pre><span id="VALcursor_on"><span class="keyword">val</span> cursor_on</span> : <code class="type">unit -> unit</code></pre><pre><span id="VALcursor_off"><span class="keyword">val</span> cursor_off</span> : <code class="type">unit -> unit</code></pre><pre><span id="VALget_screen_size"><span class="keyword">val</span> get_screen_size</span> : <code class="type">unit -> int * int</code></pre><br> <span id="3_Components"><h3>Components</h3></span> <p> We use phantom types here to add some type safety around components. All components have a type of at least <code class="code">[> `Component] component</code>. Specific types of components have an extra variant indicating the type and limiting what functions you can safely call. Thus for example buttons have type <code class="code">[`Button|`Component] component</code>. <p> A <code class="code">component_ptr</code> is a special type of component that may only be compared against other components, but not used in any way. It is returned by certain functions that get the "current" subcomponent from a form or component.<br> <pre><span id="TYPEcomponent"><span class="keyword">type</span> <code class="type">'a</code> component</span> = <code class="type">Newt._component</code> </pre> <pre><span id="TYPE_component"><span class="keyword">type</span> <code class="type"></code>_component</span> </pre> <pre><span id="TYPEcomponent_ptr"><span class="keyword">type</span> <code class="type"></code>component_ptr</span> </pre> <pre><span id="VALcomponent_equals"><span class="keyword">val</span> component_equals</span> : <code class="type"><a href="Newt.html#TYPEcomponent_ptr">component_ptr</a> -> [> `Component ] <a href="Newt.html#TYPEcomponent">component</a> -> bool</code></pre><br> <span id="4_Buttons"><h4>Buttons</h4></span><br> <pre><span id="VALcompact_button"><span class="keyword">val</span> compact_button</span> : <code class="type">int -> int -> string -> [ `Button | `Component ] <a href="Newt.html#TYPEcomponent">component</a></code></pre><pre><span id="VALbutton"><span class="keyword">val</span> button</span> : <code class="type">int -> int -> string -> [ `Button | `Component ] <a href="Newt.html#TYPEcomponent">component</a></code></pre><br> <span id="4_Checkboxesradiobuttons"><h4>Checkboxes, radio buttons</h4></span><br> <pre><span id="VALcheckbox"><span class="keyword">val</span> checkbox</span> : <code class="type">int -><br> int -><br> string -> char -> string option -> [ `Checkbox | `Component ] <a href="Newt.html#TYPEcomponent">component</a></code></pre><pre><span id="VALcheckbox_get_value"><span class="keyword">val</span> checkbox_get_value</span> : <code class="type">[> `Checkbox ] <a href="Newt.html#TYPEcomponent">component</a> -> char</code></pre><pre><span id="VALcheckbox_set_value"><span class="keyword">val</span> checkbox_set_value</span> : <code class="type">[> `Checkbox ] <a href="Newt.html#TYPEcomponent">component</a> -> char -> unit</code></pre><pre><span id="VALcheckbox_set_flags"><span class="keyword">val</span> checkbox_set_flags</span> : <code class="type">[> `Checkbox ] <a href="Newt.html#TYPEcomponent">component</a> -><br> <a href="Newt.html#TYPEflag">flag</a> list -> <a href="Newt_int.html#TYPEnewtFlagsSense">Newt_int.newtFlagsSense</a> -> unit</code></pre><pre><span id="VALradio_button"><span class="keyword">val</span> radio_button</span> : <code class="type">int -><br> int -><br> string -><br> bool -><br> [> `Radio ] <a href="Newt.html#TYPEcomponent">component</a> option -> [ `Component | `Radio ] <a href="Newt.html#TYPEcomponent">component</a></code></pre><pre><span id="VALradio_get_current"><span class="keyword">val</span> radio_get_current</span> : <code class="type">[> `Radio ] <a href="Newt.html#TYPEcomponent">component</a> -> <a href="Newt.html#TYPEcomponent_ptr">component_ptr</a></code></pre><br> <span id="4_Labels"><h4>Labels</h4></span><br> <pre><span id="VALlabel"><span class="keyword">val</span> label</span> : <code class="type">int -> int -> string -> [ `Component | `Label ] <a href="Newt.html#TYPEcomponent">component</a></code></pre><pre><span id="VALlabel_set_text"><span class="keyword">val</span> label_set_text</span> : <code class="type">[> `Label ] <a href="Newt.html#TYPEcomponent">component</a> -> string -> unit</code></pre><br> <span id="4_Scrollbars"><h4>Scrollbars</h4></span><br> <pre><span id="VALvertical_scrollbar"><span class="keyword">val</span> vertical_scrollbar</span> : <code class="type">int -><br> int -><br> int -><br> <a href="Newt.html#TYPEcolor_set">color_set</a> -><br> <a href="Newt.html#TYPEcolor_set">color_set</a> -> [ `Component | `VerticalScrollbar ] <a href="Newt.html#TYPEcomponent">component</a></code></pre><pre><span id="VALscrollbar_set"><span class="keyword">val</span> scrollbar_set</span> : <code class="type">[> `VerticalScrollbar ] <a href="Newt.html#TYPEcomponent">component</a> -> int -> int -> unit</code></pre><br> <span id="4_Listboxes"><h4>Listboxes</h4></span> <p> Newt lets you store arbitrary data for each row in a listbox. We can't let you do that, but instead we let you store values of a single type in the listbox (if you really want to store arbitrary values, use a variant). <p> The newt documentation confuses the terms 'key' and 'data' as if they refer to something different. In fact they are the same thing and we refer to it as 'data' everywhere.<br> <pre><span id="TYPElistbox"><span class="keyword">type</span> <code class="type">'a</code> listbox</span> </pre> <pre><span id="VALlistbox"><span class="keyword">val</span> listbox</span> : <code class="type">int -> int -> int -> <a href="Newt.html#TYPEflag">flag</a> list -> 'a <a href="Newt.html#TYPElistbox">listbox</a></code></pre><div class="info"> Create a listbox.<br> </div> <pre><span id="VALlistbox_get_current"><span class="keyword">val</span> listbox_get_current</span> : <code class="type">'a <a href="Newt.html#TYPElistbox">listbox</a> -> 'a option</code></pre><div class="info"> This returns the <code class="code">data</code> field from the current item, for listboxes which only allow single selection. <p> If nothing is selected, <code class="code">None</code> is returned.<br> </div> <pre><span id="VALlistbox_set_current"><span class="keyword">val</span> listbox_set_current</span> : <code class="type">'a <a href="Newt.html#TYPElistbox">listbox</a> -> int -> unit</code></pre><div class="info"> Set the current selection for listboxes which allow single selection.<br> </div> <pre><span id="VALlistbox_set_current_by_key"><span class="keyword">val</span> listbox_set_current_by_key</span> : <code class="type">'a <a href="Newt.html#TYPElistbox">listbox</a> -> 'a -> unit</code></pre><div class="info"> Set the current selection to the row containing <code class="code">data</code>.<br> <b>Raises</b> <code>Not_found</code> if data is not found.<br> </div> <pre><span id="VALlistbox_set_entry"><span class="keyword">val</span> listbox_set_entry</span> : <code class="type">'a <a href="Newt.html#TYPElistbox">listbox</a> -> int -> string -> unit</code></pre><pre><span id="VALlistbox_set_width"><span class="keyword">val</span> listbox_set_width</span> : <code class="type">'a <a href="Newt.html#TYPElistbox">listbox</a> -> int -> unit</code></pre><pre><span id="VALlistbox_set_data"><span class="keyword">val</span> listbox_set_data</span> : <code class="type">'a <a href="Newt.html#TYPElistbox">listbox</a> -> int -> 'a -> unit</code></pre><pre><span id="VALlistbox_append_entry"><span class="keyword">val</span> listbox_append_entry</span> : <code class="type">'a <a href="Newt.html#TYPElistbox">listbox</a> -> string -> 'a -> unit</code></pre><div class="info"> <code class="code">listbox_append_entry lb text data</code> appends a new listbox entry consisting of the text string <code class="code">text</code> and data <code class="code">data</code> to the end of the listbox.<br> </div> <pre><span id="VALlistbox_insert_entry"><span class="keyword">val</span> listbox_insert_entry</span> : <code class="type">'a <a href="Newt.html#TYPElistbox">listbox</a> -> string -> 'a -> 'a option -> unit</code></pre><div class="info"> <code class="code">listbox_insert_entry lb text data after</code> inserts a new listbox entry consisting of the text string <code class="code">text</code> and data <code class="code">data</code> after the current listbox entry with data field <code class="code">after</code>. It returns the position of the new entry.<br> <b>Raises</b> <code>Not_found</code> if <code class="code">after</code> is not found.<br> </div> <pre><span id="VALlistbox_delete_entry"><span class="keyword">val</span> listbox_delete_entry</span> : <code class="type">'a <a href="Newt.html#TYPElistbox">listbox</a> -> 'a -> unit</code></pre><div class="info"> <code class="code">listbox_delete_entry lb data</code> deletes the listbox entry which contains <code class="code">data</code>.<br> <b>Raises</b> <code>Not_found</code> if <code class="code">data</code> is not found.<br> </div> <pre><span id="VALlistbox_clear"><span class="keyword">val</span> listbox_clear</span> : <code class="type">'a <a href="Newt.html#TYPElistbox">listbox</a> -> unit</code></pre><div class="info"> Remove all listbox entries.<br> </div> <pre><span id="VALlistbox_get_entry"><span class="keyword">val</span> listbox_get_entry</span> : <code class="type">'a <a href="Newt.html#TYPElistbox">listbox</a> -> int -> string * 'a</code></pre><div class="info"> Return a member of the listbox.<br> </div> <pre><span id="VALlistbox_get_selection"><span class="keyword">val</span> listbox_get_selection</span> : <code class="type">'a <a href="Newt.html#TYPElistbox">listbox</a> -> 'a array</code></pre><div class="info"> <code class="code">listbox_get_selection lb</code> return an array of <code class="code">data</code> from the items selected.<br> </div> <pre><span id="VALlistbox_clear_selection"><span class="keyword">val</span> listbox_clear_selection</span> : <code class="type">'a <a href="Newt.html#TYPElistbox">listbox</a> -> unit</code></pre><div class="info"> Clear the current selection.<br> </div> <pre><span id="VALlistbox_select_item"><span class="keyword">val</span> listbox_select_item</span> : <code class="type">'a <a href="Newt.html#TYPElistbox">listbox</a> -> 'a -> <a href="Newt.html#TYPEflags_sense">flags_sense</a> -> unit</code></pre><div class="info"> Select the item containing <code class="code">data</code>.<br> <b>Raises</b> <code>Not_found</code> if data is not found.<br> </div> <pre><span id="VALlistbox_item_count"><span class="keyword">val</span> listbox_item_count</span> : <code class="type">'a <a href="Newt.html#TYPElistbox">listbox</a> -> int</code></pre><div class="info"> Return the total number of items in the listbox.<br> </div> <pre><span id="VALcomponent_of_listbox"><span class="keyword">val</span> component_of_listbox</span> : <code class="type">'a <a href="Newt.html#TYPElistbox">listbox</a> -> [ `Component | `Listbox ] <a href="Newt.html#TYPEcomponent">component</a></code></pre><div class="info"> Convert the specialised listbox type back to a normal component, eg. allowing it to be added to forms.<br> </div> <br> <span id="4_Checkboxtrees"><h4>Checkbox trees</h4></span><br> <br> <span id="4_Textboxes"><h4>Textboxes</h4></span><br> <pre><span id="VALtextbox_reflowed"><span class="keyword">val</span> textbox_reflowed</span> : <code class="type">int -><br> int -><br> string -><br> int -><br> int -> int -> <a href="Newt.html#TYPEflag">flag</a> list -> [ `Component | `Textbox ] <a href="Newt.html#TYPEcomponent">component</a></code></pre><pre><span id="VALtextbox"><span class="keyword">val</span> textbox</span> : <code class="type">int -><br> int -><br> int -> int -> <a href="Newt.html#TYPEflag">flag</a> list -> [ `Component | `Textbox ] <a href="Newt.html#TYPEcomponent">component</a></code></pre><pre><span id="VALtextbox_set_text"><span class="keyword">val</span> textbox_set_text</span> : <code class="type">[> `Textbox ] <a href="Newt.html#TYPEcomponent">component</a> -> string -> unit</code></pre><pre><span id="VALtextbox_set_height"><span class="keyword">val</span> textbox_set_height</span> : <code class="type">[> `Textbox ] <a href="Newt.html#TYPEcomponent">component</a> -> int -> unit</code></pre><pre><span id="VALtextbox_get_num_lines"><span class="keyword">val</span> textbox_get_num_lines</span> : <code class="type">[> `Textbox ] <a href="Newt.html#TYPEcomponent">component</a> -> int</code></pre><pre><span id="VALreflow_text"><span class="keyword">val</span> reflow_text</span> : <code class="type">string -> int -> int -> int -> string * int * int</code></pre><br> <span id="4_Entries"><h4>Entries</h4></span><br> <pre><span id="VALentry"><span class="keyword">val</span> entry</span> : <code class="type">int -><br> int -><br> string option -><br> int -> <a href="Newt.html#TYPEflag">flag</a> list -> [ `Component | `Entry ] <a href="Newt.html#TYPEcomponent">component</a></code></pre><pre><span id="VALentry_set"><span class="keyword">val</span> entry_set</span> : <code class="type">[> `Entry ] <a href="Newt.html#TYPEcomponent">component</a> -> string -> bool -> unit</code></pre><pre><span id="VALentry_get_value"><span class="keyword">val</span> entry_get_value</span> : <code class="type">[> `Entry ] <a href="Newt.html#TYPEcomponent">component</a> -> string</code></pre><pre><span id="VALentry_set_flags"><span class="keyword">val</span> entry_set_flags</span> : <code class="type">[> `Entry ] <a href="Newt.html#TYPEcomponent">component</a> -> <a href="Newt.html#TYPEflag">flag</a> list -> <a href="Newt.html#TYPEflags_sense">flags_sense</a> -> unit</code></pre><br> <span id="4_Scales"><h4>Scales</h4></span><br> <pre><span id="VALscale"><span class="keyword">val</span> scale</span> : <code class="type">int -> int -> int -> int64 -> [ `Component | `Scale ] <a href="Newt.html#TYPEcomponent">component</a></code></pre><pre><span id="VALscale_set"><span class="keyword">val</span> scale_set</span> : <code class="type">[> `Scale ] <a href="Newt.html#TYPEcomponent">component</a> -> int64 -> unit</code></pre><br> <span id="3_Forms"><h3>Forms</h3></span><br> <pre><span id="VALform"><span class="keyword">val</span> form</span> : <code class="type">[> `VerticalScrollbar ] <a href="Newt.html#TYPEcomponent">component</a> option -><br> string option -> <a href="Newt.html#TYPEflag">flag</a> list -> [ `Component | `Form ] <a href="Newt.html#TYPEcomponent">component</a></code></pre><pre><span id="VALform_set_timer"><span class="keyword">val</span> form_set_timer</span> : <code class="type">[> `Form ] <a href="Newt.html#TYPEcomponent">component</a> -> int -> unit</code></pre><pre><span id="VALform_watch_fd"><span class="keyword">val</span> form_watch_fd</span> : <code class="type">[> `Form ] <a href="Newt.html#TYPEcomponent">component</a> -> Unix.file_descr -> <a href="Newt.html#TYPEfd_flag">fd_flag</a> list -> unit</code></pre><pre><span id="VALform_set_size"><span class="keyword">val</span> form_set_size</span> : <code class="type">[> `Form ] <a href="Newt.html#TYPEcomponent">component</a> -> unit</code></pre><pre><span id="VALform_get_current"><span class="keyword">val</span> form_get_current</span> : <code class="type">[> `Form ] <a href="Newt.html#TYPEcomponent">component</a> -> <a href="Newt.html#TYPEcomponent_ptr">component_ptr</a></code></pre><pre><span id="VALform_set_background"><span class="keyword">val</span> form_set_background</span> : <code class="type">[> `Form ] <a href="Newt.html#TYPEcomponent">component</a> -> int -> unit</code></pre><pre><span id="VALform_set_current"><span class="keyword">val</span> form_set_current</span> : <code class="type">[> `Form ] <a href="Newt.html#TYPEcomponent">component</a> -> [> `Component ] <a href="Newt.html#TYPEcomponent">component</a> -> unit</code></pre><pre><span id="VALform_add_component"><span class="keyword">val</span> form_add_component</span> : <code class="type">[> `Form ] <a href="Newt.html#TYPEcomponent">component</a> -> [> `Component ] <a href="Newt.html#TYPEcomponent">component</a> -> unit</code></pre><pre><span id="VALform_add_components"><span class="keyword">val</span> form_add_components</span> : <code class="type">[> `Form ] <a href="Newt.html#TYPEcomponent">component</a> -> [> `Component ] <a href="Newt.html#TYPEcomponent">component</a> list -> unit</code></pre><pre><span id="VALform_set_height"><span class="keyword">val</span> form_set_height</span> : <code class="type">[> `Form ] <a href="Newt.html#TYPEcomponent">component</a> -> int -> unit</code></pre><pre><span id="VALform_set_width"><span class="keyword">val</span> form_set_width</span> : <code class="type">[> `Form ] <a href="Newt.html#TYPEcomponent">component</a> -> int -> unit</code></pre><pre><span id="VALrun_form"><span class="keyword">val</span> run_form</span> : <code class="type">[> `Form ] <a href="Newt.html#TYPEcomponent">component</a> -> <a href="Newt.html#TYPEcomponent_ptr">component_ptr</a> option</code></pre><pre><span id="VALform_run"><span class="keyword">val</span> form_run</span> : <code class="type">[> `Form ] <a href="Newt.html#TYPEcomponent">component</a> -> <a href="Newt_int.html#TYPEnewtExitStruct">Newt_int.newtExitStruct</a></code></pre><pre><span id="VALform_add_hot_key"><span class="keyword">val</span> form_add_hot_key</span> : <code class="type">[> `Form ] <a href="Newt.html#TYPEcomponent">component</a> -> int -> unit</code></pre><br> <span id="3_Genericcomponentfunctions"><h3>Generic component functions</h3></span><br> <pre><span id="VALcomponent_takes_focus"><span class="keyword">val</span> component_takes_focus</span> : <code class="type">[> `Component ] <a href="Newt.html#TYPEcomponent">component</a> -> bool -> unit</code></pre><div class="info"> <code class="code">component_takes_focus co bool</code> enables or disables a component.<br> </div> <pre><span id="VALcomponent_add_callback"><span class="keyword">val</span> component_add_callback</span> : <code class="type">[> `Component ] <a href="Newt.html#TYPEcomponent">component</a> -> (unit -> unit) -> unit</code></pre><div class="info"> <code class="code">component_add_callback co f</code> adds a general callback function <code class="code">f</code> to a component. This is only available for certain types of component -- see the Newt documentation for more information.<br> </div> <br> <span id="2_Keys"><h2>Keys</h2></span><br> </body></html>