mitem_current(3X)
okay bestie, welcome to mitem_current(3X) โ this one lives in the Library calls section, and itโs literally all about setting and getting the current menu item. ๐
๐ NAME ๐
mitem_current โ set and get current_menu_item ๐
โจ SYNOPSIS โจ
#include <menu.h>
int set_current_item(MENU *menu, ITEM *item);
ITEM *current_item(const MENU *menu);
int set_top_row(MENU *menu, int row);
int top_row(const MENU *menu);
int item_index(const ITEM *item);
๐ DESCRIPTION ๐
okay so bestie, hereโs the tea: set_current_item sets the current item โ aka the item on which the menu cursor is positioned. current_item returns a pointer to the current item in the given menu. main character behavior, no cap. ๐
set_top_row sets the top row of the menu to show the given row. The top row is initially 0, and it is reset to this value whenever the O_ROWMAJOR option is toggled. The item leftmost on the given row becomes current. top_row returns the number of the top menu row being displayed. slay. ๐ฆ
item_index returns the (zero-origin) index of item in the menuโs item pointer list. iykyk. ๐ฅ
๐ฎ RETURN VALUE ๐ฎ
current_item returns a pointer (which may be NULL). It does not set errno. ngl, that part matters. ๐
top_row and item_index return ERR (the general curses error value) if their menu parameter is NULL. yes, fr fr. ๐
set_current_item and set_top_row return one of the following:
E_OKโ the routine succeeded. periodt. โจE_BAD_ARGUMENTโ routine detected an incorrect or out-of-range argument. not the vibe. ๐ญE_BAD_STATEโ routine was called from an initialization or termination function. wrong moment, bestie. ๐ซE_NOT_CONNECTEDโ no items are connected to the menu. itโs giving empty group chat. ๐E_SYSTEM_ERRORโ system error occurred (seeerrno(3)). go checkerrno(3), bestie. ๐
๐ PORTABILITY ๐
These routines emulate the System V menu library. They were not supported on Version 7 or BSD versions. history lesson, but make it menu. ๐
The SVr4 menu library documentation specifies the top_row and index_item error value as -1 (which is the value of ERR). yes, it says index_item there โ weโre keeping it exactly as the page says. ๐
๐ AUTHORS ๐
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. icons only. ๐ซถ
๐ธ SEE ALSO ๐ธ
curses(3X), menu(3X) โ go read those too, bestie. ๐
and thatโs a wrap, bestie! ๐ซถ this page is from ncurses 6.5, dated 2024-12-28 โ mitem_current(3X) forever. periodt ๐
โจ
๐ฆ 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-2006,2010 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