menu\_opts(3X) Library calls menu\_opts(3X)

# [NAME](#NAME)

**set\_menu\_opts**, **menu\_opts\_on**, **menu\_opts\_off**, **menu\_opts** - set and get menu options

# [SYNOPSIS](#SYNOPSIS)

```
#include <menu.h>
```

```
int set_menu_opts(MENU *menu, Menu_Options opts);
Menu_Options menu_opts(const MENU *menu);
```

```
int menu_opts_on(MENU *menu, Menu_Options opts);
int menu_opts_off(MENU *menu, Menu_Options opts);
```

# [DESCRIPTION](#DESCRIPTION)

The function **set\_menu\_opts** sets all the given menu's option bits (menu option bits may be logically “or”-ed together).

The function **menu\_opts\_on** turns on the given option bits, and leaves others alone.

The function **menu\_opts\_off** turns off the given option bits, and leaves others alone.

The function **menu\_opts** returns the menu's current option bits.

The following options are defined (all are on by default):

[O\_ONEVALUE](#O_ONEVALUE)

Only one item can be selected for this menu.

[O\_SHOWDESC](#O_SHOWDESC)

Display the item descriptions when the menu is posted.

[O\_ROWMAJOR](#O_ROWMAJOR)

Display the menu in row-major order.

[O\_IGNORECASE](#O_IGNORECASE)

Ignore the case when pattern-matching.

[O\_SHOWMATCH](#O_SHOWMATCH)

Move the cursor to within the item name while pattern-matching.

[O\_NONCYCLIC](#O_NONCYCLIC)

Don't wrap around next-item and previous-item, requests to the other end of the menu.

[O\_MOUSE\_MENU](#O_MOUSE_MENU)

If user clicks with the mouse and it does not fall on the currently active menu, push **KEY\_MOUSE** and the **MEVENT** data back on the queue to allow processing in another part of the calling program.

# [RETURN VALUE](#RETURN_VALUE)

Except for **menu\_opts**, each routine returns one of the following:

[**E\_OK**](#E_OK)

The routine succeeded.

[**E\_SYSTEM\_ERROR**](#E_SYSTEM_ERROR)

System error occurred (see [**errno**(3)](/man/os/ncurses/errno.3)).

[**E\_POSTED**](#E_POSTED)

The menu is already posted.

# [PORTABILITY](#PORTABILITY)

These routines emulate the System V menu library. They were not supported on Version 7 or BSD versions.

# [AUTHORS](#AUTHORS)

Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond.

# [SEE ALSO](#SEE_ALSO)

[**curses**(3X)](/man/os/ncurses/curses.3X), [**menu**(3X)](/man/os/ncurses/menu.3X)

2025-01-18 ncurses 6.6

---

Document: set_menu_opts(3x) from ncurses 6.6.20261017-r0 (Chainguard OS)
Source: https://github.com/ThomasDickey/ncurses-snapshots
