Delete SWindow or Exit FSlateApplication

Hello. I tried extend ue4 editor. I did add a new button to toolbar. When I click a window is appear. But whenever I click the button, a new window is appear and the old one stay active. I could not found destroy or exit window method. Just find OnExitRequestedHandler methot. But I dont know how can I use it. Any suggestion? Thanks for help

If you want to always generate the same window you should call ‘invoke nomad tab’ to instantiate a SDockTab instead.
There’s some usage cases inside of engine source code.

I solved my problem. Here it is.


TSharedPtr<SWindow> ParentWindow = MainFrameModule.GetParentWindow();

        if (ParentWindow.IsValid() && OpenWindow.IsValid()==false)
        {
            //Açılan  pencereyi bir değişkene tanımlandı.
            OpenWindow=FSlateApplication::Get().AddWindowAsNativeChild(MyToolBarWindow.ToSharedRef(), ParentWindow.ToSharedRef());


            //GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("active window"));



        }
        else {

            OpenWindow.Get()->DestroyWindowImmediately();//açılan pencere destroy edildi.
            OpenWindow.Reset();        //değişken sıfırlandı.


        }