form_win(3X)

πŸ’– form_win(3X) β€” or, how to make and break form window + subwindow associations πŸ’–

okay bestie, gather round, because this one is from the form_win(3X) manual and it's genuinely so useful πŸŽ€


✨ NAME ✨

form_win β€” make and break 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);

like. look at her. five whole functions. she's serving πŸ’…


πŸ‘‘ DESCRIPTION πŸ‘‘

so every form has an associated pair of curses windows, and they are NOT the same job okay:

  • the form window displays any title and border associated with the window πŸ–ΌοΈ
  • the form subwindow displays the items of the form that are currently available for selection 🎯

the first four functions get and set those windows, periodt.

and here's the thing β€” you do not have to set either window. literally not required. by default, the driver code just uses stdscr for both 🌈 (main character energy from stdscr, honestly).

in the set_ functions:

  • a window argument of NULL is treated as though it were stdscr
  • a form argument of NULL is treated as a request to change the system default form window or subwindow πŸ‘€

and scale_form returns the minimum size required for the subwindow of form. it's giving "how much room do I actually need" ✨


πŸ”₯ 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 πŸ₯³
  • E_SYSTEM_ERROR β€” system error occurred (see errno(3)) 😭
  • E_BAD_ARGUMENT β€” routine detected an incorrect or out-of-range argument πŸ’€
  • E_POSTED β€” the form has already been posted πŸ“Œ
  • E_NOT_CONNECTED β€” no items are connected to the form πŸ«₯

🧚 PORTABILITY 🧚

these routines emulate the System V forms library, iykyk. they were not supported on Version 7 or BSD versions, so if you're on one of those, bestie… it's not happening πŸ™ˆ


πŸ’œ AUTHORS πŸ’œ

Juergen Pfeifer. manual pages and adaptation for new curses by Eric S. Raymond. legends, honestly πŸ‘‘


🌟 SEE ALSO 🌟

  • curses(3X)
  • curs_variables(3X)
  • form(3X)

and that's the whole page, babe πŸ’– this came to you from ncurses 6.6, dated 2024-12-28 β€” go forth and associate those windows, you absolute icon πŸŽ€βœ¨

πŸ“¦ where this page comes from