[SOLVED][SLATE] Destroy a ListView Context Menu

I am writing a plugin and have got a pretty good grasp on things so far, except for slate. I have a SListView slate object, which is working flawlessly. If I right click the **SListView **widget, I can successfully create a context menu that includes a button. When I click the button, my implemented functionality works, but the Context Menu widget stays visible.

I create the Context Menu widget with the **SAssignNew **macro. I am wondering how I go about removing the context menu after the button has been clicked.

I’ve tried:



CurrentContextMenu->SetVisibility(EVisibility::Hidden);
CurrentContextMenu.Reset();


Which renders a weird result, as I have to click the button twice for the visibility redraw to take effect.

I cannot find any method to remove the context menu either. I’ve been looking through the **UE4 Source **and the **Slate Viewer **source also.

Regards,

Aaron1178

Solved thanks to user **TCFX **from the Unreal Slackers Discord Server.



FSlateApplication::Get().DismissAllMenus();