embedded-menu icon indicating copy to clipboard operation
embedded-menu copied to clipboard

Better support for dynamically built menus

Open bugadani opened this issue 1 year ago • 2 comments

Currently, dynamic lists of menu items are only possible in a very restricted way: it is not possible to arbitrarily mix and match navigation and selection items.

Unfortunately, we can't make the menu items object-safe because:

What we can do instead is to wrap menu items in an enum. We only need this to support "polymorphism" in add_items, and there are two key questions to consider:

  • ergonomics
  • support user-defined menu items (i.e. easily define a wrapper enum around N specific menu item impls)

bugadani avatar Aug 09 '23 04:08 bugadani

I'm not entirely sure if this is within the same vein of this issue, but is it being considered changing embedded-menu to be immediate mode rather than the current retained mode patterns? This would enable a developer to more easily create dynamic menus without requiring embedded-menu to develop a way to handle complex and mutable menu topology.

BroderickCarlin avatar Nov 05 '23 04:11 BroderickCarlin

I've never considered immediate mode. I also don't have neither the knowledge nor enough time to make such a fundamental change to embedded-menu, unfortunately.

bugadani avatar Nov 05 '23 06:11 bugadani