Closing StartViewer Window from inside the code

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

mytree->StartViewer();

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.

Hi,

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

Cheers,
Philippe

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