diff --git a/doc/man/man3/notcurses_menu.3.md b/doc/man/man3/notcurses_menu.3.md index 7a4e9b239..8a4dd17af 100644 --- a/doc/man/man3/notcurses_menu.3.md +++ b/doc/man/man3/notcurses_menu.3.md @@ -64,13 +64,12 @@ typedef struct ncmenu_options { # DESCRIPTION -A notcurses instance supports menu bars on the top or bottom row of the true -screen. A menu is composed of sections, which are in turn composed of items. -Either no sections are visible, and the menu is *rolled up*, or exactly one -section is *unrolled*. **ncmenu_rollup** places an ncmenu in the rolled up -state. **ncmenu_unroll** rolls up any unrolled section, and unrolls the -specified one. **ncmenu_destroy** removes a menu bar, and frees all associated -resources. +A notcurses instance supports menu bars on the top or bottom row of a plane. +A menu is composed of sections, which are in turn composed of items. Either no +sections are visible, and the menu is *rolled up*, or exactly one section is +*unrolled*. **ncmenu_rollup** places an ncmenu in the rolled up state. +**ncmenu_unroll** rolls up any unrolled section, and unrolls the specified one. +**ncmenu_destroy** removes a menu bar, and frees all associated resources. **ncmenu_selected** return the selected item description, or NULL if no section is unrolled, or no valid item is selected. **ncmenu_mouse_selected** returns diff --git a/include/notcurses/notcurses.h b/include/notcurses/notcurses.h index bf4b0d2a2..cbb85e36d 100644 --- a/include/notcurses/notcurses.h +++ b/include/notcurses/notcurses.h @@ -3281,7 +3281,7 @@ API void nctree_destroy(struct nctree* n); // Menus. Horizontal menu bars are supported, on the top and/or bottom rows. // If the menu bar is longer than the screen, it will be only partially // visible. Menus may be either visible or invisible by default. In the event of -// a screen resize, menus will be automatically moved/resized. Elements can be +// a plane resize, menus will be automatically moved/resized. Elements can be // dynamically enabled or disabled at all levels (menu, section, and item), struct ncmenu_item { char* desc; // utf-8 menu item, NULL for horizontal separator @@ -3306,9 +3306,7 @@ typedef struct ncmenu_options { uint64_t flags; // flag word of NCMENU_OPTION_* } ncmenu_options; -// Create a menu with the specified options. Menus are currently bound to an -// overall Notcurses object (as opposed to a particular plane), and are -// implemented as ncplanes kept atop other ncplanes. +// Create a menu with the specified options, bound to the specified plane. API ALLOC struct ncmenu* ncmenu_create(struct ncplane* n, const ncmenu_options* opts) __attribute__ ((nonnull (1))); diff --git a/src/lib/menu.c b/src/lib/menu.c index 80163d375..4ef1d847e 100644 --- a/src/lib/menu.c +++ b/src/lib/menu.c @@ -356,7 +356,7 @@ ncmenu* ncmenu_create(ncplane* n, const ncmenu_options* opts){ ret->sectioncount = opts->sectioncount; ret->sections = NULL; int dimy, dimx; - ncplane_dim_yx(notcurses_stdplane(ncplane_notcurses(n)), &dimy, &dimx); + ncplane_dim_yx(n, &dimy, &dimx); if(ret){ ret->bottom = !!(opts->flags & NCMENU_OPTION_BOTTOM); if(dup_menu_sections(ret, opts, &totalwidth, &totalheight) == 0){