I’m poking around in Slate for the first time and it’s pretty neat. I’ve created a tab, added some UI and added a button, but when I instantiate the tab in the editor the entire editor hangs.
- How do you debug something like that?
- How should I have implemented it?
This is what I have:
I was originally getting following error during compile:
error C2039: 'AsShared' : is not a member of 'FMyPluginModule'
So after googling around, in my .h file I inherited from the TSharedFromThis template:
class FMyPluginModule : public IModuleInterface, public TSharedFromThis<FMyPluginModule >
Which is fine until the tab instantiates, then it hangs.
I fired up the debugger with the onclicked() line as a breakpoint but I’m still a bit new to this so without knowing more about the engine and delegates, it wasn’t very helpful.
So, what’d I do wrong?
I understand the basic concept of delegates and I’ve used them in C# but naturally everything is more difficult in C++. In particular I don’t have my head around the TSharedRef<> template yet. In particular, can someone explain what’s happening here?
TSharedRef<class SDockTab> OnSpawnPluginTab(const class FSpawnTabArgs& SpawnTabArgs);
So I’m assuming that when this is instantiated, a value somewhere is incremented so that SDockTab can be garbage collected once OnSpawnPluginTab is removed. Is this right? My description feels a bit ***-backwards to me.
Are there any good resources to read that would help me out here?