Wt WText Scrollbar

286 views Asked by At

I have a little question about Wt. When I create WText (child of a WContainerWidget and having a long long text), Scrollbars are not created for this WText. I have tried many things like setting overflow (with setOverflow function of WContainerWidget), putting this text class into WScrollArea and etc..

If you have some kind of opinions about that problem, I would be glad.

Thanks everyone by now. Mustafa

Edit: Code example

MyApplication::MyApplication(Wt::WEnvironment const &env)
  : Wt::WApplication(env)
{
  std::string str = "..." // a very long html string
  auto text = new Wt::WText(str, Wt::XHTMLUnsafeText);

  root()->setOverflow(OverflowAuto);
  root()->addWidget(text);
}
1

There are 1 answers

0
Benny On BEST ANSWER

You could use a Wt::WTextArea instead of WText, if its a large file. Its scrollable.