ncurses 6.0 - patch 20151205
[ncurses.git] / doc / html / man / form.3x.html
1 <!-- 
2   * t
3   ****************************************************************************
4   * Copyright (c) 1998-2014,2015 Free Software Foundation, Inc.              *
5   *                                                                          *
6   * Permission is hereby granted, free of charge, to any person obtaining a  *
7   * copy of this software and associated documentation files (the            *
8   * "Software"), to deal in the Software without restriction, including      *
9   * without limitation the rights to use, copy, modify, merge, publish,      *
10   * distribute, distribute with modifications, sublicense, and/or sell       *
11   * copies of the Software, and to permit persons to whom the Software is    *
12   * furnished to do so, subject to the following conditions:                 *
13   *                                                                          *
14   * The above copyright notice and this permission notice shall be included  *
15   * in all copies or substantial portions of the Software.                   *
16   *                                                                          *
17   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
18   * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
19   * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
20   * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
21   * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
22   * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
23   * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
24   *                                                                          *
25   * Except as contained in this notice, the name(s) of the above copyright   *
26   * holders shall not be used in advertising or otherwise to promote the     *
27   * sale, use or other dealings in this Software without prior written       *
28   * authorization.                                                           *
29   ****************************************************************************
30   * @Id: form.3x,v 1.26 2015/08/02 18:14:50 tom Exp @
31 -->
32 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
33 <HTML>
34 <HEAD>
35 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
36 <meta name="generator" content="Manpage converted by man2html - see http://invisible-island.net/scripts/readme.html#others_scripts">
37 <TITLE>form 3x</TITLE>
38 <link rev=made href="mailto:bug-ncurses@gnu.org">
39 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
40 </HEAD>
41 <BODY>
42 <H1 class="no-header">form 3x</H1>
43 <PRE>
44 <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>                                                       <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>
45
46
47
48
49 </PRE>
50 <H2><a name="h2-NAME">NAME</a></H2><PRE>
51        <STRONG>form</STRONG> - curses extension for programming forms
52
53
54 </PRE>
55 <H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
56        <STRONG>#include</STRONG> <STRONG>&lt;form.h&gt;</STRONG>
57
58
59 </PRE>
60 <H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
61        The  <STRONG>form</STRONG> library provides terminal-independent facilities
62        for composing form screens  on  character-cell  terminals.
63        The  library  includes:  field  routines, which create and
64        modify form fields; and form routines, which group  fields
65        into forms, display forms on the screen, and handle inter-
66        action with the user.
67
68        The <STRONG>form</STRONG> library uses the <STRONG>curses</STRONG> libraries.   To  use  the
69        <STRONG>form</STRONG> library, link with the options <STRONG>-lform</STRONG> <STRONG>-lcurses</STRONG>.
70
71        Your program should set up the locale, e.g.,
72
73             <STRONG>setlocale(LC_ALL,</STRONG> <STRONG>"");</STRONG>
74
75        so that input/output processing will work.
76
77        A  curses  initialization  routine such as <STRONG>initscr</STRONG> must be
78        called before using any of these functions.
79
80
81 </PRE>
82 <H3><a name="h3-Current-Default-Values-for-Field-Attributes">Current Default Values for Field Attributes</a></H3><PRE>
83        The <STRONG>form</STRONG> library  maintains  a  default  value  for  field
84        attributes.   You  can  get or set this default by calling
85        the appropriate <STRONG>set_</STRONG> or  retrieval  routine  with  a  <STRONG>NULL</STRONG>
86        field pointer.  Changing this default with a <STRONG>set_</STRONG> function
87        affects future field creations, but does  not  change  the
88        rendering of fields already created.
89
90
91 </PRE>
92 <H3><a name="h3-Routine-Name-Index">Routine Name Index</a></H3><PRE>
93        The  following  table lists each <STRONG>form</STRONG> routine and the name
94        of the manual page on which it is described.
95
96        <STRONG>curses</STRONG> Routine Name    Manual Page Name
97        -------------------------------------------------
98        current_field          <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
99        data_ahead             <STRONG><A HREF="form_data.3x.html">form_data(3x)</A></STRONG>
100        data_behind            <STRONG><A HREF="form_data.3x.html">form_data(3x)</A></STRONG>
101        dup_field              <STRONG><A HREF="form_field_new.3x.html">form_field_new(3x)</A></STRONG>
102        dynamic_field_info     <STRONG><A HREF="form_field_info.3x.html">form_field_info(3x)</A></STRONG>
103        field_arg              <STRONG><A HREF="form_field_validation.3x.html">form_field_validation(3x)</A></STRONG>
104        field_back             <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
105        field_buffer           <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
106        field_count            <STRONG><A HREF="form_field.3x.html">form_field(3x)</A></STRONG>
107        field_fore             <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
108        field_index            <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
109        field_info             <STRONG><A HREF="form_field_info.3x.html">form_field_info(3x)</A></STRONG>
110        field_init             <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
111        field_just             <STRONG><A HREF="form_field_just.3x.html">form_field_just(3x)</A></STRONG>
112        field_opts             <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
113        field_opts_off         <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
114        field_opts_on          <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
115        field_pad              <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
116        field_status           <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
117        field_term             <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
118        field_type             <STRONG><A HREF="form_field_validation.3x.html">form_field_validation(3x)</A></STRONG>
119
120        field_userptr          <STRONG><A HREF="form_field_userptr.3x.html">form_field_userptr(3x)</A></STRONG>
121        form_driver            <STRONG><A HREF="form_driver.3x.html">form_driver(3x)</A></STRONG>
122        form_driver_w          <STRONG><A HREF="form_driver.3x.html">form_driver(3x)</A></STRONG>*
123        form_fields            <STRONG><A HREF="form_field.3x.html">form_field(3x)</A></STRONG>
124        form_init              <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
125        form_opts              <STRONG><A HREF="form_opts.3x.html">form_opts(3x)</A></STRONG>
126        form_opts_off          <STRONG><A HREF="form_opts.3x.html">form_opts(3x)</A></STRONG>
127        form_opts_on           <STRONG><A HREF="form_opts.3x.html">form_opts(3x)</A></STRONG>
128        form_page              <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
129        form_request_by_name   <STRONG><A HREF="form_requestname.3x.html">form_requestname(3x)</A></STRONG>
130        form_request_name      <STRONG><A HREF="form_requestname.3x.html">form_requestname(3x)</A></STRONG>
131        form_sub               <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
132        form_term              <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
133        form_userptr           <STRONG><A HREF="form_userptr.3x.html">form_userptr(3x)</A></STRONG>
134        form_win               <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
135        free_field             <STRONG><A HREF="form_field_new.3x.html">form_field_new(3x)</A></STRONG>
136        free_fieldtype         <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
137        free_form              <STRONG><A HREF="form_new.3x.html">form_new(3x)</A></STRONG>
138        link_field             <STRONG><A HREF="form_field_new.3x.html">form_field_new(3x)</A></STRONG>
139        link_fieldtype         <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
140        move_field             <STRONG><A HREF="form_field.3x.html">form_field(3x)</A></STRONG>
141        new_field              <STRONG><A HREF="form_field_new.3x.html">form_field_new(3x)</A></STRONG>
142        new_fieldtype          <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
143        new_form               <STRONG><A HREF="form_new.3x.html">form_new(3x)</A></STRONG>
144        new_page               <STRONG><A HREF="form_new_page.3x.html">form_new_page(3x)</A></STRONG>
145        pos_form_cursor        <STRONG><A HREF="form_cursor.3x.html">form_cursor(3x)</A></STRONG>
146        post_form              <STRONG><A HREF="form_post.3x.html">form_post(3x)</A></STRONG>
147        scale_form             <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
148        set_current_field      <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
149        set_field_back         <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
150        set_field_buffer       <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
151        set_field_fore         <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
152        set_field_init         <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
153        set_field_just         <STRONG><A HREF="form_field_just.3x.html">form_field_just(3x)</A></STRONG>
154        set_field_opts         <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
155        set_field_pad          <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
156        set_field_status       <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
157        set_field_term         <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
158        set_field_type         <STRONG><A HREF="form_field_validation.3x.html">form_field_validation(3x)</A></STRONG>
159        set_field_userptr      <STRONG><A HREF="form_field_userptr.3x.html">form_field_userptr(3x)</A></STRONG>
160        set_fieldtype_arg      <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
161        set_fieldtype_choice   <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
162        set_form_fields        <STRONG><A HREF="form_field.3x.html">form_field(3x)</A></STRONG>
163        set_form_init          <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
164        set_form_opts          <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
165        set_form_page          <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
166        set_form_sub           <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
167        set_form_term          <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
168        set_form_userptr       <STRONG><A HREF="form_userptr.3x.html">form_userptr(3x)</A></STRONG>
169        set_form_win           <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
170        set_max_field          <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
171        set_new_page           <STRONG><A HREF="form_new_page.3x.html">form_new_page(3x)</A></STRONG>
172        unpost_form            <STRONG><A HREF="form_post.3x.html">form_post(3x)</A></STRONG>
173
174
175 </PRE>
176 <H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
177        Routines that return pointers return <STRONG>NULL</STRONG>  on  error,  and
178        set  errno  to  the  corresponding  error-code returned by
179        functions returning an integer.  Routines that  return  an
180        integer return one of the following error codes:
181
182        <STRONG>E_OK</STRONG> The routine succeeded.
183
184        <STRONG>E_BAD_ARGUMENT</STRONG>
185             Routine  detected  an incorrect or out-of-range argu-
186             ment.
187
188        <STRONG>E_BAD_STATE</STRONG>
189             Routine was called from an initialization or termina-
190             tion function.
191
192        <STRONG>E_CONNECTED</STRONG>
193             The field is already connected to a form.
194
195        <STRONG>E_INVALID_FIELD</STRONG>
196             Contents of a field are not valid.
197
198        <STRONG>E_NOT_CONNECTED</STRONG>
199             No fields are connected to the form.
200
201        <STRONG>E_NOT_POSTED</STRONG>
202             The form has not been posted.
203
204        <STRONG>E_NO_ROOM</STRONG>
205             Form is too large for its window.
206
207        <STRONG>E_POSTED</STRONG>
208             The form is already posted.
209
210        <STRONG>E_REQUEST_DENIED</STRONG>
211             The form driver could not process the request.
212
213        <STRONG>E_SYSTEM_ERROR</STRONG>
214             System error occurred (see <STRONG>errno</STRONG>).
215
216        <STRONG>E_UNKNOWN_COMMAND</STRONG>
217             The form driver code saw an unknown request code.
218
219
220 </PRE>
221 <H2><a name="h2-NOTES">NOTES</a></H2><PRE>
222        The header file <STRONG>&lt;form.h&gt;</STRONG> automatically includes the header
223        files <STRONG>&lt;curses.h&gt;</STRONG> and <STRONG>&lt;eti.h&gt;</STRONG>.
224
225        In your library list, libform.a  should  be  before  libn-
226        curses.a; that is, you want to say `-lform -lncurses', not
227        the other way around (which would give you  a  link  error
228        using most linkers).
229
230
231 </PRE>
232 <H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
233        These  routines  emulate the System V forms library.  They
234        were not supported on Version 7 or BSD versions.
235
236
237 </PRE>
238 <H2><a name="h2-AUTHORS">AUTHORS</a></H2><PRE>
239        Juergen Pfeifer.  Manual pages and adaptation for  ncurses
240        by Eric S. Raymond.
241
242
243 </PRE>
244 <H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
245        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names begin "form_" for
246        detailed descriptions of the entry points.
247
248        This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20151205).
249
250
251
252                                                                <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>
253 </PRE>
254 <div class="nav">
255 <ul>
256 <li><a href="#h2-NAME">NAME</a></li>
257 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
258 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
259 <ul>
260 <li><a href="#h3-Current-Default-Values-for-Field-Attributes">Current Default Values for Field Attributes</a></li>
261 <li><a href="#h3-Routine-Name-Index">Routine Name Index</a></li>
262 </ul>
263 </li>
264 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
265 <li><a href="#h2-NOTES">NOTES</a></li>
266 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
267 <li><a href="#h2-AUTHORS">AUTHORS</a></li>
268 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
269 </ul>
270 </div>
271 </BODY>
272 </HTML>