Skip to content

How to support horizontal overflow? #1006

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

You must be logged in to vote

Hi @jeaye,

For this particular example, maybe you can wrap the content into a xframe? This way, the elements won't be constrained on the width.

#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include <ftxui/screen/string.hpp>

int main()
{
  using namespace ftxui;

  auto content = hbox({
    text("this "),
    text("will "),
    text("end up "),
    text("being longer "),
    text("than "),
    text("the window "),
    text("so "),
    text("it should overflow "),
    text("rather than squishing "),
    text("the other lines "),
    text("all text should be readable "),
    text("up until the cutoff for the overflow"),
  });
  content |= xframe;
  auto document = wi…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@ArthurSonzogni
Comment options

@jeaye
Comment options

@jeaye
Comment options

@ArthurSonzogni
Comment options

@jeaye
Comment options

Answer selected by jeaye
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