Any examples of using UWidgetTree::ForEachWidget?

I’m trying to iterate over a VerticalBox created in UMG, the box has buttons
and I want to get the content of the VerticalBox

I see that I can use UWidgetTree but have no idea how to use it

please help


Not sure if you still need help with this, but for anyone else that’s stuck, you can find an example of how to use this function in the GetAllWidgets function from the WidgetTree.cpp file:

void UWidgetTree::GetAllWidgets(TArray& Widgets) const
ForEachWidget([&] (UWidget* Widget) { Widgets.Add(Widget); });

A lambda function is required.