menu_spacing(3X)
πΈ menu_spacing(3X) β the spacing glow-up for your menuz π
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 thanTABSIZE. 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 than3. 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 thanTABSIZE. π
also super important: a value of0for all the spacing values resets them to the default, which is1for all of them. periodt. so0is not "zero space", it's "back to factory settings" energy β¨
menu_spacing β the getter era π
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
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright 2018-2023,2024 Thomas E. Dickey
- Copyright 1998-2010,2015 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms