Skip to content

Could I use a Vector ADT class or a string array for creating a menu? #934

Discussion options

You must be logged in to vote

Hello @antialberteinstein

using your FTXUI library to develop a terminal UI for my project at university (Project By Learning 2)

Cool! I would love to see the results ;-) Feel free to share it when you are done.

I would like to know if it’s possible to use a custom ADT class in place

You have two options:

  1. The Menu is implemented using public APIs, so you should be able to copy-paste the implementation to make it your own.
  2. In the latests versions of FTXUI, you can implement a ConstStringListRef::Adapter, and pass it to the MenuOption::entries.
  auto menu = Menu({
      .entries = Adapter::From(&entries),
      .selected = &selected,
  });
Full example:
// Copyright 2020 Arthur So…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ArthurSonzogni
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants