Is there a standard way to add/remove items, or change the descriptions, etc ? Or do I need to simply unpost, free up everything, then reallocate a new menu and start over? My menu has up to 2000 options so I'd really like to avoid allocating and reallocating if possible.
There is this question that doesn't really have any answer: Creating a dynamic menu in ncurses
No - there's no standard way. With ncurses, the structure members are visible, so you could make a variation of new_item
, which modified the pointers (and lengths) for the text.
Aside from that, there's (standard) set_menu_items
. A quick read of the source shows that you could replace the items in the menu with the same list (with a different item here and there), but that resets the overall menu state, so you would have to save/restore those values before posting the menu again.