Download

Could not create context menu.

I have a widget, and I want to make context menu that shows up when I make right click on the widget.
So,I have parent widget, that contains listView.
And I create many child widget, that contains textBlock entries;
When I create parent widget, I construct entry widgets, set textBlock value and add them to listView.
List view is hidden by default.


UUserWidget* widget = WidgetTree->ConstructWidget<UUserWidget>(listItemWidgetClass);

UListItemCpp* newListItem = Cast<UListItemCpp>(widget);
newListItem->setText("some text");// here I just set value into textblock

listView->AddItem(newListItem);

Then I click on the parent widget, and see my context menu, but textblock contains default value.


FEventReply  OnMouseButtonDownImpl(    FGeometry MyGeometry,
    const FPointerEvent& MouseEvent) {
....

listView->SetVisibility(ESlateVisibility::Visible);
.....
}

Please, help, what do I wrong?