blob: 4a75b294ce01c8cfa2fdc2be42ce23cc7d97c196 [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -04002.\" Copyright 2018-2023,2024 Thomas E. Dickey *
3.\" Copyright 1998-2006,2010 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05304.\" *
5.\" Permission is hereby granted, free of charge, to any person obtaining a *
6.\" copy of this software and associated documentation files (the *
7.\" "Software"), to deal in the Software without restriction, including *
8.\" without limitation the rights to use, copy, modify, merge, publish, *
9.\" distribute, distribute with modifications, sublicense, and/or sell *
10.\" copies of the Software, and to permit persons to whom the Software is *
11.\" furnished to do so, subject to the following conditions: *
12.\" *
13.\" The above copyright notice and this permission notice shall be included *
14.\" in all copies or substantial portions of the Software. *
15.\" *
16.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
17.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
18.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
19.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
20.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
21.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
22.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23.\" *
24.\" Except as contained in this notice, the name(s) of the above copyright *
25.\" holders shall not be used in advertising or otherwise to promote the *
26.\" sale, use or other dealings in this Software without prior written *
27.\" authorization. *
28.\"***************************************************************************
29.\"
micky3879b9f5e72025-07-08 18:04:53 -040030.\" $Id: form_win.3x,v 1.35 2024/03/16 15:35:01 tom Exp $
31.TH form_win 3X 2024-03-16 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053032.SH NAME
micky3879b9f5e72025-07-08 18:04:53 -040033\fBform_win\fP \-
34make and break form window and subwindow associations
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053035.SH SYNOPSIS
micky3879b9f5e72025-07-08 18:04:53 -040036.nf
37\fB#include <form.h>
38.PP
39\fBint set_form_win(FORM *\fIform\fP, WINDOW *\fIwin\fP);
40\fBWINDOW *form_win(const FORM *\fIform\fP);
41.PP
42\fBint set_form_sub(FORM *\fIform\fP, WINDOW *\fIsub\fP);
43\fBWINDOW *form_sub(const FORM *\fIform\fP);
44.PP
45\fBint scale_form(const FORM *\fIform\fP, int *\fIrows\fP, int *\fIcolumns\fP);
46.fi
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053047.SH DESCRIPTION
micky3879b9f5e72025-07-08 18:04:53 -040048Every form has an associated pair of \fBcurses\fP windows.
49The form window
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053050displays any title and border associated with the window; the form subwindow
51displays the items of the form that are currently available for selection.
52.PP
micky3879b9f5e72025-07-08 18:04:53 -040053The first four functions get and set those windows.
54It is not necessary to set
55either window; by default, the driver code uses \fBstdscr\fP for both.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053056.PP
micky3879b9f5e72025-07-08 18:04:53 -040057In the \fBset_\fP functions, window argument of \fBNULL\fP is treated as though
58it were \fBstsdcr\fP. A form argument of \fBNULL\fP is treated as a request
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053059to change the system default form window or subwindow.
60.PP
micky3879b9f5e72025-07-08 18:04:53 -040061The function \fBscale_form\fP returns the minimum size required for the
62subwindow of \fIform\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053063.SH RETURN VALUE
micky3879b9f5e72025-07-08 18:04:53 -040064Routines that return pointers return \fBNULL\fP on error.
65Routines that return
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053066an integer return one of the following error codes:
67.TP 5
68.B E_OK
69The routine succeeded.
70.TP 5
71.B E_SYSTEM_ERROR
micky3879b9f5e72025-07-08 18:04:53 -040072System error occurred (see \fBerrno\fP(3)).
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053073.TP 5
74.B E_BAD_ARGUMENT
75Routine detected an incorrect or out-of-range argument.
76.TP 5
77.B E_POSTED
78The form has already been posted.
79.TP 5
80.B E_NOT_CONNECTED
81No items are connected to the form.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053082.SH PORTABILITY
micky3879b9f5e72025-07-08 18:04:53 -040083These routines emulate the System V forms library.
84They were not supported on
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053085Version 7 or BSD versions.
86.SH AUTHORS
micky3879b9f5e72025-07-08 18:04:53 -040087Juergen Pfeifer.
88Manual pages and adaptation for new curses by Eric S. Raymond.
89.SH SEE ALSO
90\fB\%curses\fP(3X),
91\fB\%curs_variables\fP(3X),
92\fB\%form\fP(3X)