field_attributes(3FORM)

✨ field_attributes(3FORM) ✨

okay bestie, so this is a library call situation β€” specifically, the part of ncurses that lets you control the vibes (colors and attributes) of your form fields. yes, your little text boxes can have main character energy. let's get into it πŸ’…


πŸŽ€ NAME πŸŽ€

form_field_attributes β€” color and attribute control for form fields


🌸 SYNOPSIS 🌸

#include <form.h>

int set_field_fore(FIELD *field, chtype attr);
chtype field_fore(const FIELD *field);

int set_field_back(FIELD *field, chtype attr);
chtype field_back(const FIELD *field);

int set_field_pad(FIELD *field, int pad);
int field_pad(const FIELD *field);

πŸ’– DESCRIPTION πŸ’–

okay so there's basically three little duos here, one for each vibe knob. let me walk you through them 🫢

  • set_field_fore sets the foreground attribute of field. this is the highlight used to display the field contents. and field_fore returns that foreground attribute. the default is A_STANDOUT β€” yes, it comes pre-glowed, no cap ✨
  • set_field_back sets the background attribute of form. this is the highlight used to display the extent fields in the form. and field_back returns the background attribute. the default is A_NORMAL β€” chill, plain, unbothered πŸ’œ
  • set_field_pad sets the character used to fill the field. and field_pad returns the given form's pad character. the default is a blank. lowkey iconic that a space is the default, honestly πŸ¦‹

πŸ’€ RETURN VALUE πŸ’€

these routines return one of the following, and bestie, you will be checking it:

  • E_OK β€” the routine succeeded. slay, we ate πŸŽ€
  • E_BAD_ARGUMENT β€” routine detected an incorrect or out-of-range argument. something you passed is giving chaos 😭
  • E_SYSTEM_ERROR β€” system error occurred (see errno(3)). not us, it's the system fr fr

🌈 PORTABILITY 🌈

these routines emulate the System V forms library. they were not supported on Version 7 or BSD versions. so if you're time-traveling to ancient Unix, manage your expectations 🧚


πŸ‘‘ AUTHORS πŸ‘‘

Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. legends, truly 🫢


🌟 SEE ALSO 🌟

ncurses(3NCURSES) and related pages whose names begin β€œform_” for detailed descriptions of the entry points. go read those, iykyk πŸ“š


quick reminder bestie: the defaults are A_STANDOUT for foreground, A_NORMAL for background, and a blank for the pad character. don't come for me if you forgot, i literally just told you πŸ’…

and that's the whole page, periodt ✨ this was from ncurses version 6.6, dated 2024-03-16 β€” stay glowy out there πŸ’–

πŸ“¦ where this page comes from