swh:1:snp:af87cd67498ef4fe47c76ed3e7caffe5b61facaf
Raw File
Tip revision: 82fc2dc7e13477e717020c761e227ed4e3f7012e authored by Axel Naumann on 07 June 2022, 15:59:39 UTC
"Update ROOT version files to v6.26/04."
Tip revision: 82fc2dc
fileopen.C
// @(#)macros:$Id$
// Author: Axel Naumann, 2008-05-22
//
// This script gets executed when double-clicking a ROOT file (currently only on Windows).
// The file that got double clicked and opened is accessible as _file0.

void onBrowserClose() {
   gApplication->Terminate(0);
}

void fileopen()
{
   TBrowser *b = new TBrowser;
   // or, to only browse the file:
   // new TBrowser(_file0);

   // Quit ROOT when the browser gets closed:
   b->GetBrowserImp()->GetMainFrame()->Connect("CloseWindow()", 0, 0, "onBrowserClose()");
}
back to top