menu_cursor(3X)

Okay so you found your way into the menu_cursor(3X) page and I'm so proud of you πŸ’– this is the one that tells you how to put the cursor back where it belongs. Let's go, no cap.


🌸 NAME 🌸

pos_menu_cursor β€” position a menu's cursor 🎯


πŸŽ€ SYNOPSIS πŸŽ€

#include <menu.h>

int pos_menu_cursor(const MENU *menu);

πŸ’… DESCRIPTION πŸ’…

So pos_menu_cursor restores the cursor right back to the current position that's associated with the menu's selected item. Iconic behaviour, honestly. 🫢

And like, why would you even want that? Because it's genuinely useful after some curses routines have been called to do screen-painting in response to a menu select. You painted all over the screen, the cursor got lost in the sauce, and now you're dragging it home. Main character move. ✨


πŸ‘‘ RETURN VALUE πŸ‘‘

This routine hands you back one of the following, and you will check it:

  • E_OK β€” the routine succeeded. Slay. πŸŽ‰
  • E_SYSTEM_ERROR β€” a system error occurred (go peek at errno(3)). 😭
  • E_BAD_ARGUMENT β€” the routine detected an incorrect or out-of-range argument. Not the vibe. πŸ’€
  • E_NOT_POSTED β€” the menu has not been posted. Girl, you gotta post it first. πŸ™ˆ

🌈 PORTABILITY 🌈

These routines emulate the System V menu library. They were not supported on Version 7 or BSD versions. That's just the lore, iykyk. πŸ¦‹


πŸ’œ AUTHORS πŸ’œ

Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. Legends, fr fr. πŸ‘‘


⭐ SEE ALSO ⭐

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

And that's the whole page, bestie πŸ“ this was ncurses 6.6, dated 2024-03-16 β€” mwah, take care of that cursor of yours πŸ’–πŸ§š

πŸ“¦ where this page comes from