How to spawn Slate widget at runtime

What I want to do is:

  1. Spawn new slate widget at runtime.

  2. Spawn X widgets at runtime.

  3. Destroy newly spawned widgets after certain conditions are meet. Like time expired or incoming event.

  1. TSharedPtr<MyButton> = SNew(SButton);
  2. The above in a for-loop
  3. Widgets are generally held in shared pointers. When you reset the last shared pointer to a widget to nullptr then the widget will automatically self destruct, i.e. void FMyClass::HandleSomeEvent() { MyButton.Reset(); }