menu_spacing(3X)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

okay bestie so this one is a library call (yes, from the menu crew) and it's all about ✨*spacing*✨ β€” the little breathing room between your menu items. two lil functions, one page, let's go 🫢


✨ SYNOPSIS ✨

#include <menu.h>

int set_menu_spacing(MENU *menu,
                     int spc_description,
                     int spc_rows,
                     int spc_columns);
int menu_spacing(const MENU *menu,
                 int* spc_description,
                 int* spc_rows,
                 int* spc_columns);

like, look at those signatures. gorgeous. no notes. πŸŽ€


πŸ’– DESCRIPTION πŸ’–

set_menu_spacing β€” the setter era πŸ‘‘

set_menu_spacing literally sets the spacing info for the menu. its parameters give you the description and the size (in rows and columns). here's the breakdown, iykyk:

  • spc_description β€” controls the number of spaces between an item name and an item description. it must not be larger than TABSIZE. the menu system puts the pad character right in the middle of this spacing area, and the remaining parts are filled with spaces. 🧚
  • spc_rows β€” controls the number of rows that are used for an item. it must not be larger than 3. the menu system inserts the blank lines between item rows, and those lines will contain the pad character in the appropriate positions. πŸ’€ (yes, really, three rows max, don't push it)
  • spc_columns β€” controls the number of blanks between columns of items. it must not be larger than TABSIZE. 🌈
also super important: a value of 0 for all the spacing values resets them to the default, which is 1 for all of them. periodt. so 0 is not "zero space", it's "back to factory settings" energy ✨

menu_spacing returns the spacing information for the menu. and here's the cute part β€” if a pointer is NULL, that corresponding information is simply not returned. no drama, no crash, she just minds her business. πŸ™ˆ


⭐ RETURN VALUE ⭐

both routines return E_OK on success. slay.

set_menu_spacing may also return:

  • E_POSTED β€” if the menu is posted (wrong time, babe 😭)
  • E_BAD_ARGUMENT β€” if one of the spacing values is out of range

πŸ¦‹ PORTABILITY πŸ¦‹

these routines are specific to ncurses. they were not supported on Version 7, BSD or System V implementations. so if you're writing code that depends on them, it is recommended that you condition it using NCURSES_VERSION. do not skip this, fr fr, it's giving "my code won't compile on the ancient system" energy πŸ’€


πŸ‘‘ AUTHORS πŸ‘‘

Juergen Pfeifer. manual pages and adaptation for new curses by Eric S. Raymond. absolute icons, we stan 🫢


πŸ”₯ SEE ALSO πŸ”₯

  • curses(3X)
  • curs_variables(3X)
  • menu(3X)

and that's the whole page bestie β€” brought to you by ncurses 6.5, dated 2024-12-28 🌸 go forth and space your menu items responsibly πŸ’œ

πŸ“¦ where this page comes from