Skip to content

Nested Tab #366

Answered by ArthurSonzogni
tdolata asked this question in Q&A
Discussion options

You must be logged in to vote

Hello.

Yes, you can compose anything, inside anything. You just have to create two of them. One inside the other.

Example 1
#include <string>
#include "ftxui/component/component.hpp"
#include "ftxui/component/screen_interactive.hpp"
#include "ftxui/dom/elements.hpp"

using namespace ftxui;

// Create component, rendering the |label|.
Component MakeEmpty(std::string label) {
  return Renderer([label] { return text(label); });
}

int main(int argc, const char* argv[]) {
  std::vector<std::string> entries = {"one", "two", "three", "four"};

  // 1. Make the nested tab.
  int nested_tab_selected = 0;
  auto nested_tab_toggle = Toggle(&entries, &nested_tab_selected);
  auto nested_tab_content = 

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ArthurSonzogni
Comment options

You must be logged in to vote
0 replies
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
Converted from issue

This discussion was converted from issue #365 on March 22, 2022 00:47.