jcs's openbsd hax
openbsd
1.\" $OpenBSD: mitem_value.3,v 1.5 2023/10/17 09:52:10 nicm Exp $
2.\"
3.\"***************************************************************************
4.\" Copyright 2018-2022,2023 Thomas E. Dickey *
5.\" Copyright 1998-2010,2015 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.\"
32.\" $Id: mitem_value.3,v 1.5 2023/10/17 09:52:10 nicm Exp $
33.TH mitem_value 3 2023-07-01 "ncurses 6.4" "Library calls"
34.SH NAME
35\fBset_item_value\fP,
36\fBitem_value\fP \- set and get menu item values
37.SH SYNOPSIS
38\fB#include <menu.h>\fP
39.sp
40\fBint set_item_value(ITEM *\fIitem\fB, bool \fIvalue\fB);\fR
41.br
42\fBbool item_value(const ITEM *\fIitem\fB);\fR
43.SH DESCRIPTION
44If you turn off the menu option \fBO_ONEVALUE\fP (e.g., with
45\fBset_menu_opts\fP or \fBmenu_opts_off\fP; see \fBmenu_opts\fP(3)), the menu
46becomes multi-valued; that is, more than one item may simultaneously be
47selected.
48.PP
49In a multi_valued menu, you can used \fBset_item_value\fP to select the
50given menu item (second argument \fBTRUE\fP) or deselect it (second argument
51\fBFALSE\fP).
52.SH RETURN VALUE
53The function \fBset_item_value\fP returns one of the following:
54.TP 5
55.B E_OK
56The routine succeeded.
57.TP 5
58.B E_SYSTEM_ERROR
59System error occurred (see \fBerrno\fP(3)).
60.TP 5
61.B E_REQUEST_DENIED
62The menu driver could not process the request.
63.SH SEE ALSO
64\fBcurses\fP(3), \fBmenu\fP(3).
65.SH NOTES
66The header file \fB<menu.h>\fP automatically includes the header file
67\fB<curses.h>\fP.
68.SH PORTABILITY
69These routines emulate the System V menu library.
70They were not supported on
71Version 7 or BSD versions.
72.SH AUTHORS
73Juergen Pfeifer.
74Manual pages and adaptation for new curses by Eric S. Raymond.