How do I invoke a tab or Slate window?

I’m working on creating an editor for a plugin and while I’ve figured out how to add a button to the toolbar that the user will use to invoke it, I don’t actually know how to do so.

That said, this is as far as I’ve gotten:

   void EditorToolbarButton_Clicked()
    {
    		UE_LOG(PluginEditor, Log, TEXT("User Clicked Editor Toolbar Button"));

           //TODO: Invoke the editor here :)
    }

Based on the code I’ve seen so far, it looks like I need to register a tab spawner with the FGlobalTabManager. Also, I see that the FGlobalTabManager, or more precisely, that FTabManager has an invoke procedure, which looks like it might be exactly what I’m looking for. I’m just not sure how to use it :slight_smile:

Furthermore, I created a very basic style class that inherits from ISlateStyle. How do I specify that this style should be used for the layout of the tab in question?

FGlobalTabManager::Get()->InvokeTab(“MyCoolTab”);

Where MyCoolTab is the name you used when registering your tab spawner.

Thank you very much kind sir!

How would you spawn tabs in-game, at runtime? Can you do this inside a ChildSlot?

Dock tabs are meant to be runnable as separate windows. You probably don’t want to use them for in-game UI.

If you are looking for something like a page control (i.e. a widget that looks like a tabbed control), then you currently need to build your own, i.e. using a combination of SWidgetSwitcher and a number of SButton for the tabs.

Also, I’m not sure whether we will build a page control like widget anytime soon. We had discussed this internally several times, but decided against it. Reason being that we don’t want to use this pattern in the Editor, because it will confuse users with the existing tab control patterns and we also don’t want to add more nested layers of tabbing, and for all other use cases, such as in-game, there are just too many different ways of arranging and styling such a widget.

We decided for now that it is better to just provide the components and then people can use those to build their own tabbed widgets in any way they want.