According to other posts it looks like you have to step through each component:
TSharedRef<SWidget> USubmergedOptionsMenuUserWidget::RebuildWidget()
{
TSharedRef<SWidget> OurWidget = Super::RebuildWidget();
for (UWidget* Widget : Components)
{
if (Widget->IsA(USubmergedMenuWidget::StaticClass()))
{
//found it now do whatever you need to it, store the pointer etc
break;
}
}
return OurWidget;
}
But “Components” is not a valid class member so the compile fails. Can someone explain what I am missing?
My issue was that I was searching for widgets before they were initialized. Placing my code in the Construct_Implementation() corrects the issue. Another gotcha I encountered was making sure the “exitGame” function was a UFUNCTION().
I am trying to do something like this as well but my Construct_Implementation function is not being called. Can you please detail how exactly you implemented it in your header file ? I have it declared as
virtual void Construct_Implementation() override;
and my class derives from UUserWidget
UCLASS()
class TASKBASEDLM_API UDebugMenuWidget : public UUserWidget