form_field_opts(3X)
π form_field_opts(3X) β setting & getting field options π
okay bestie, so this is a library calls page from the 3X manual, and it's literally all about giving your form fields the vibes they deserve. think of it as the settings menu for your fields β¨
π¦ SYNOPSIS π¦
so first you gotta pull in the header, obviously:
#include <form.h>
and then here's the whole squad of functions β copy these exactly, no cap:
int set_field_opts(FIELD *field, Field_Options opts);
Field_Options field_opts(const FIELD *field);
int field_opts_on(FIELD *field, Field_Options opts);
int field_opts_off(FIELD *field, Field_Options opts);
πΈ DESCRIPTION πΈ
set_field_opts β this one sets all the given field's option bits π
(and yes, field option bits may be logically βorβ-ed together, so you can stack them like your fave accessories).
field_opts_on β turns on the given option bits and leaves the others alone. very "just this one thing, not the whole personality."
field_opts_off β turns off the given option bits and leaves the others alone. main character energy: it doesn't touch anything else.
field_opts β returns the field's current option bits. a little peek at what's going on π«Ά
β¨ the standard options β all on by default β¨
these are the classic ones, and heads up, all are on by default:
O_ACTIVEβ the field is visited during processing. if this option is off, the field will not be reachable by navigation keys. also, please notice that an invisible field appears to be inactive also πO_AUTOSKIPβ skip to the next field when this one fills. bye, next π¨O_BLANKβ the field is cleared whenever a character is entered at the first position.O_EDITβ the field can be edited. it's giving editable πO_NULLOKβ allow a blank field. sometimes empty is a vibe.O_PASSOKβ validate field only if modified by user. no changes, no stress.O_PUBLICβ the field contents are displayed as data is entered. everyone sees it, no secrets.O_STATICβ field buffers are fixed to field's original size. turn this option off to create a dynamic field. it's a whole switch-up.O_VISIBLEβ the field is displayed. if this option is off, display of the field is suppressed. ghost mode activated.O_WRAPβ words that do not fit on a line are wrapped to the next line. and yes, words are blank-separated.
π the extension options β off by default π
these are the extension girlypops, and extensions are off by default:
O_DYNAMIC_JUSTIFYβ permit dynamic fields to be justified, like static fields. equality fr.O_NO_LEFT_STRIPβ preserve leading whitespace in the field buffer, which is normally discarded. keep the space, it's aesthetic.O_EDGE_INSERT_STAYβ when inserting into a field up to the boundary position, optionally delay the scrolling, so that the last inserted character remains visible, but advance the cursor to reflect the insertion. this allows the form library to display the inserted character in one-character fields as well as allowing the library to maintain consistent state. iconic behavior honestly.O_INPUT_FIELDβ theset_max_fieldfunction checks for this extension, which allows a dynamic field to shrink if the new limit is smaller than the current field size. glow-down rights π
β RETURN VALUE β
so, except for field_opts, each routine returns one of the following:
E_OKβ the routine succeeded. slay πE_BAD_ARGUMENTβ routine detected an incorrect or out-of-range argument. not the vibe.E_CURRENTβ the field is the current field. it's literally the current one.E_SYSTEM_ERRORβ system error occurred (seeerrno(3)). π
π PORTABILITY π
these routines emulate the System V forms library. they were not supported on Version 7 or BSD versions. so like, know your origins bestie.
π AUTHORS π
Juergen Pfeifer. manual pages and adaptation for new curses by Eric S. Raymond. legends only π«Ά
π SEE ALSO π
curses(3X)form(3X)form_field_just(3X)
ngl, this page is from ncurses 6.5, dated 2025-01-18 β and that's the cute little sign-off from form_field_opts(3X). periodt. β¨ππ
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright 2018-2024,2025 Thomas E. Dickey
- Copyright 1998-2014,2015 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms