I am making a menu in slate that has a menu bar and a bar that takes up the rest of the top of the screen. Right now I have what I’m showing below in the Construct method. However, this causes a crash, specifically a “Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffffffffffff” crash after about 100 milliseconds. I am looking for how to fix this.
FSlateColorBrush FSB = FSlateColorBrush(FLinearColor::Gray);
ChildSlot
[
SNew(SBorder)
.HAlign(HAlign_Fill)
.VAlign(VAlign_Fill)
.OnMouseButtonDown(this, &SPRGDMenu::OnItemClicked)
[
SNew(SBox)
.HeightOverride(1.0)
.WidthOverride(100.0)
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.HAlign(EHorizontalAlignment::HAlign_Left)
.AutoWidth()
.VAlign(EVerticalAlignment::VAlign_Top)
[
SPRGDMenu::MakeMenuBar()
]
+ SHorizontalBox::Slot()
.VAlign(EVerticalAlignment::VAlign_Top)
.FillWidth(1.0)
[
SNew(SImage)
// code crashes here
.Image(&FSB)
]
]
]
];
Alternatively, I am just looking for a way to make an SImage with a solid color in Slate.