Skip to content

menu elements API and factories #148

@Xeverous

Description

@Xeverous

So I have checked multiple examples but I haven't found any menu that would fully satisfy me.

My ideal menu element would:

  • Have just 1 callback (void (std::size_t index)). I may store arbitrary elements and getting the selected item index is the only reasonable way for the library to report it.
  • The menu would expose a standard container interface (eg vector, either by deriving from it or having m.options()) so that one can add/remove option elements freely (this is much more flexible than is_enabled option functor). Adding things such as menu_item_spacer should not change/shift indexes of reported selections.
  • There should be an access to the menu's label (eg m.label())

Obviosuly I know that any arbitrary widget can be made through use of other library parts. This is just the thing that IMO is a good general use-case scenario to be in the API which is not overly complex at the same time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions