Closing StartViewer Window from inside the code

:question: Once one has open the TreeViewer window using:


how can one close the TreeViewer window from inside the code of the program? I have tried:

  TVirtualTreePlayer *tp = fRootTree->GetPlayer();
  delete tp;

but it breaks the program at the close of the file. Thanks a lot in advance.


From the interpreter you can do:delete gTV;
But probably better, you should create the TTreeViewer directly:


Thanks a lot. I have tried the second solution, and it works