Im trying to declare a delegate to pass it to a SplitterSlot OnSlorResize()
so i have declared the delegate as follow on the RA_SDetailBlock.h file:
DECLARE_DELEGATE_OneParam(RowOnLeftSlotResize, float)
RowOnLeftSlotResize LeftSlotResize;
and this is the .cpp file :
void RA_SDetailBlock::Construct(const FArguments & args)
{
RA_SDetailBlock::RowOnLeftSlotResize::CreateSP(this, &RA_SDetailBlock::OnLeftColumnResized); // ACCESS VIOLATION ERROR DELEGATE
SAssignNew(verticalBox, SVerticalBox)
+SVerticalBox::Slot()
.AutoHeight()
.VAlign(VAlign_Top)[args._Content.Widget];
for (auto child : args.Slots) {
FSlot& nSlot = *new FSlot();
addSlotToBlock(&nSlot[child->GetCurrSlot()]);
}
ChildSlot
[
verticalBox.ToSharedRef()
];
}
void RA_SDetailBlock::addSlotToBlock(RA_SDetailBlock::FSlot* FSlot)
{
Slots.Add(FSlot);
FSlot->GetCurrSlot()->LeftSplitterSlot->OnSlotResized(LeftSlotResize);
verticalBox->AddSlot()
.AutoHeight()
.VAlign(VAlign_Top)[FSlot->GetCurrSlot()];
}
void RA_SDetailBlock::OnLeftColumnResized(float InNewWidth)
{
float t = InNewWidth;
}
i’m trying to figure out how to use delegates and how they works but i think i may not have fully understood how to properly use or declare them