form_page(3X)
π form_page(3X) β the one where we set & get form page numbers π
okay bestie, sit down, hydrate, and let's talk about form_page(3X). this one's a Library calls girlie from the ncurses 6.6 era, and she's literally all about pages, fields, and focus. no cap, it's giving "underrated". let's go π¦
β¨ NAME β¨
form_page β set and get form page number πΈ
π SYNOPSIS π
#include <form.h>
int set_current_field(FORM *form, FIELD *field);
FIELD *current_field(const FORM *form);
int unfocus_current_field(FORM *form);
int set_form_page(FORM *form, int n);
int form_page(const FORM *form);
int field_index(const FIELD *field);
π DESCRIPTION π
okay so, first up: set_current_field sets the current field of the given form, and current_field hands you back the current field of the given form. matching set, they're a duo, they ate π
then there's unfocus_current_field, which removes the focus from the current field of the form. and listen β while you're in that state, any inquiry via current_field shall return a NULL pointer. she's empty on purpose, it's a vibe π
set_form_page sets the form's page number, aka it goes to page n of the form. yes, page n. very demure, very mindful π
form_page returns the form's current page number. that's the whole job and she does it flawlessly β
last but never least, field_index returns the index of the field in the field array of the form it is connected to. but heads up bestie: it returns ERR if the argument is the null pointer, or if the field is not connected. so likeβ¦ plug in your field first π
π RETURN VALUE π
except for form_page, each routine returns one of the following:
E_OKβ the routine succeeded. slay, no notes, we love a happy ending β¨E_BAD_ARGUMENTβ routine detected an incorrect or out-of-range argument. you gave her something she cannot work with πE_BAD_STATEβ routine was called from an initialization or termination function. wrong place, wrong time, read the room πE_INVALID_FIELDβ contents of a field are not valid. the field is going through something πE_REQUEST_DENIEDβ the form driver could not process the request. she said no π«ΆE_SYSTEM_ERRORβ system error occurred (seeerrno(3)). not her fault, blame the system π₯
π§ PORTABILITY π§
these routines emulate the System V forms library. they were not supported on Version 7 or BSD versions β so if you're on ancient territory, that's a no from her πΈ
and important: the unfocus_current_field function is an ncurses extension. so it's her special little extra, iykyk π
π AUTHORS π
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. absolute icons, we thank them for their service π
π₯ SEE ALSO π₯
curses(3X)form(3X)
okay that's the whole page, you're officially a form_page(3X) expert now, go forth and set those page numbers bestie π
β¨
this has been ncurses 6.6, dated 2024-12-28, signing off from the form_page(3X) page β mwah, bye ππ¦
π¦ where this page comes from
- alpine 3.24: ncurses-doc 6.6_p20260516-r0 Β· X11
- arch rolling: ncurses 6.6-2 Β· MIT-open-group
- fedora 44: ncurses-devel 6.6-1.fc44 Β· MIT-open-group
- fedora 44: ncurses-devel 6.6-1.fc44 Β· MIT-open-group
- Copyright 2018-2023,2024 Thomas E. Dickey
- Copyright 1998-2010,2016 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms