Creating a new editor window

Custom editor windows are useful when you have a new tool with user-configurable settings, or want to display some information to people using your customized editor.

Be sure to have an editor module by following the recipe earlier in this chapter before you start.

Read through either the Creating new menu entries or Creating new toolbar buttons recipes so that you can create a button within the editor that will launch our new window.

How to do it…

  1. Inside your command's bound function, add the following code:
    TSharedRef<SWindow> CookbookWindow = SNew(SWindow) .Title(FText::FromString(TEXT("Cookbook Window"))) .ClientSize(FVector2D(800, 400)) .SupportsMaximize(false) .SupportsMinimize(false) [ SNew(SVerticalBox) +SVerticalBox::Slot() ...

Get Unreal Engine 4 Scripting with C++ Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.