Dear Community,
How do I add a button to a newly created plugin’s editor window? I have done the following:
-
Editor → plugin → new plugin → editor standalone window
-
named it FirstEditorWindow
-
Looking into a method in FirstEditorWindow.cpp called OnSpawnPlugin tab because the message in the editor window told me so…
TSharedRef FFirstEditorWindowModule::OnSpawnPluginTab(const FSpawnTabArgs& SpawnTabArgs)
{
FText WidgetText = FText::Format(
LOCTEXT(“WindowWidgetText”, “Add code to {0} in {1} to override this window’s contents”),
FText::FromString(TEXT(“FFirstEditorWindowModule::OnSpawnPluginTab”)),
FText::FromString(TEXT(“FirstEditorWindow.cpp”))
);return SNew(SDockTab).TabRole(ETabRole::NomadTab) [ // Put your tab content here! SNew(SBox) .HAlign(HAlign_Center) .VAlign(VAlign_Center) [ SNew(STextBlock) .Text(WidgetText) ] ];
}
-
tried to replace SNew(SBox) with SNew(SButton) like this:
SNew(SButton)
.Text(WidgetText)
However, it didn’t work I have tried to find SLAT API documentation, but no luck.
Thank You all