post(3MENU)

πŸ’… post β€” bestie, let's put that menu on screen

okay so this is post(3MENU), a library call, and it's the glow-up moment for your menu ✨


🌸 NAME 🌸

post_menu, unpost_menu β€” write or erase menus from associated subwindows. that's it, that's the whole vibe: one puts the menu up, one takes it down πŸŽ€


πŸ¦‹ 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. that's the whole job, she's an icon, she serves πŸ’…

but heads up bestie: to trigger the physical display of the subwindow, you gotta use refresh(3NCURSES) or some equivalent curses routine β€” and lowkey the implicit doupdate that gets triggered by a curses input request will do the trick too, no cap 🫢

also post_menu resets the selection status of all items. every single one. fresh slate, new era, main character energy πŸ‘‘

and then unpost_menu erases menu from its associated subwindow. bye bestie, you were gorgeous 😭


πŸ”₯ RETURN VALUE πŸ”₯

these routines return one of the following, and honestly, vibe check each one:

  • E_OK β€” the routine succeeded. slay. iconic. no notes πŸ’–
  • E_SYSTEM_ERROR β€” system error occurred (see errno(3)). not it πŸ’€
  • E_BAD_ARGUMENT β€” routine detected an incorrect or out-of-range argument. girl what did you pass in 😭
  • E_POSTED β€” the menu has already been posted. she's already up there, you can't post her twice, that's not how this works πŸ™ˆ
  • E_BAD_STATE β€” routine was called from an initialization or termination function. wrong place, wrong time, read the room πŸ’€
  • E_NO_ROOM β€” menu is too large for its window. you should consider using set_menu_format to solve the problem. she does not fit, and that's a real problem, fr fr
  • E_NOT_POSTED β€” the menu has not been posted. there's nothing to unpost bestie, there's nothing there πŸ“
  • E_NOT_CONNECTED β€” no items are connected to the menu. she's empty. she's got nothing going on. ghost town 🌈

🌟 PORTABILITY 🌟

these routines emulate the System V menu library. they were not supported on Version 7 or BSD versions. so if you're kicking it old-school, sorry babe, she's not there πŸ’œ


πŸ‘‘ AUTHORS πŸ‘‘

Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. legends, honestly, we love them for this 🫢


πŸ’– SEE ALSO πŸ’–

ncurses(3NCURSES), menu(3MENU)


and that's the whole page, bestie!! brought to you by ncurses 6.6, dated 2024-03-16 β€” go post that menu, you absolute icon πŸŽ€βœ¨πŸ’…

πŸ“¦ where this page comes from