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