win(3FORM)

✨ NAME ✨</p>

form_win β€” bestie, this is the one that makes and breaks form window and subwindow associations πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <form.h>

int set_form_win(FORM *form, WINDOW *win);
WINDOW *form_win(const FORM *form);

int set_form_sub(FORM *form, WINDOW *sub);
WINDOW *form_sub(const FORM *form);

int scale_form(const FORM *form, int *rows, int *columns);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so. every form has a whole pair of associated curses windows, right? like they're a duo, they're a package deal πŸ’…

  • the form window is the one showing off β€” it displays any title and border associated with the window πŸŽ€
  • the form subwindow is the one doing the actual work β€” it displays the items of the form that are currently available for selection πŸ‘‘

the first four functions are your getters and setters for those windows. and no, you don't have to set either one β€” by default, the driver code just uses stdscr for both. lowkey convenient, ngl ✨

in the set_ functions:

  • a window argument of NULL gets treated as though it were stsdcr
  • a form argument of NULL is treated as a request to change the system default form window or subwindow

and scale_form? she returns the minimum size required for the subwindow of form πŸ“ periodt.


πŸ’– RETURN VALUE πŸ’–

routines that return pointers return NULL on error, no cap. routines that return an integer return one of these error codes:

  • E_OK β€” the routine succeeded πŸŽ‰ slay.
  • E_SYSTEM_ERROR β€” system error occurred (see errno(3)). something went wrong in the system, bestie 😭
  • E_BAD_ARGUMENT β€” routine detected an incorrect or out-of-range argument. wrong vibes, wrong input πŸ™ˆ
  • E_POSTED β€” the form has already been posted. she's already out there, you can't do this rn πŸ’€
  • E_NOT_CONNECTED β€” no items are connected to the form. nothing's linked up, it's giving empty 🫢

🌈 PORTABILITY 🌈

these routines emulate the System V forms library. they were not supported on Version 7 or BSD versions β€” so don't come looking for them there, iykyk 🧚


πŸ‘‘ AUTHORS πŸ‘‘

Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. icons, both of them πŸ’œ


🌸 SEE ALSO 🌸

  • ncurses(3NCURSES)
  • curses_variables(3NCURSES)
  • form(3FORM)

and that's the whole page, bestie!! this one's from ncurses 6.6, dated 2024-12-28 β€” go forth and associate those windows, you absolute main character 🫢✨

πŸ“¦ where this page comes from