SWindow::SetOnWindowClosed

Sets the delegate to execute right before the window is closed