0

I am trying to add dynamically a child in a SScrollBox but I get error.

TSharedRef<SScrollBox> MainCanvas = SNew(SScrollBox);
TSharedRef < SButton> TestButton = SNew(SButton);

MainCanvas->AddChild(TestButton); //AddChild not defined

It seems that addchild is not defined.

How could I add a widget inside scrollbox?

SNos
  • 3,430
  • 5
  • 42
  • 92

1 Answers1

0

you should use UScrollBox. UScrollBox is child class of UPanelWidget. so you can use AddChild(UWidget * Content) function.

also you should use UButton instead of SButton, too.

Jooh
  • 11
  • 2