menu_post(3X)

✨ menu_post β€” bestie edition ✨

okay so this is a page from the ncurses library calls section, and it's literally all about putting a menu on the screen and taking it back off again. two functions, one glow-up, let's go πŸ’…


🌸 NAME 🌸

post_menu, unpost_menu β€” write or erase menus from associated subwindows. that's it, that's the whole job, no notes 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <menu.h>

int post_menu(MENU *menu);
int unpost_menu(MENU *menu);

πŸ’– DESCRIPTION πŸ’–

so post_menu displays a menu to its associated subwindow. it's giving "put it where it belongs" energy.

and bestie, listen β€” just calling post_menu does not mean the subwindow is physically on your screen yet. to actually trigger physical display of the subwindow you gotta use refresh(3X) or some equivalent curses routine. (the implicit doupdate that gets triggered by a curses input request will do it too, so sometimes it just happens for you, lowkey iconic.) πŸͺ„

also super important: post_menu resets the selection status of all items. every single one. brand new slate. no carrying over your old faves.

and unpost_menu? it erases menu from its associated subwindow. clean exit, we love to see it. 🌈


⭐ RETURN VALUE ⭐

these routines return one of the following, and ngl the vibes vary:

  • E_OK β€” the routine succeeded. slay. ate. no crumbs. πŸ‘‘
  • E_SYSTEM_ERROR β€” a system error occurred (see errno(3)). not her fault, blame the system πŸ’€
  • E_BAD_ARGUMENT β€” the routine detected an incorrect or out-of-range argument. you handed it something cursed bestie 😭
  • E_POSTED β€” the menu has already been posted. girl it's already up there, what more do you want πŸ™ˆ
  • E_BAD_STATE β€” the routine was called from an initialization or termination function. wrong place, wrong time, we don't do that here 🚫
  • E_NO_ROOM β€” the menu is too large for its window. you should consider using set_menu_format to solve the problem. it doesn't fit, it's not a vibe, resize the situation πŸ’…
  • E_NOT_POSTED β€” the menu has not been posted. you can't unpost what was never posted, babe ✨
  • E_NOT_CONNECTED β€” no items are connected to the menu. empty menu, empty heart πŸ¦‹

🌺 PORTABILITY 🌺

these routines emulate the System V menu library. they were not supported on Version 7 or BSD versions. so if you're time-traveling backwards, no menu posting for you, sorry πŸ•°οΈ


πŸ’œ AUTHORS πŸ’œ

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


🌟 SEE ALSO 🌟

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

and that's the whole page bestie, tysm for reading, go post a menu responsibly ✨

this has been ncurses 6.6, dated 2024-03-16, signing off from menu_post(3X) β€” mwah πŸ’‹

πŸ“¦ where this page comes from