00001 // @(#)macros:$Id: fileopen.C 30889 2009-10-27 15:31:04Z axel $ 00002 // Author: Axel Naumann, 2008-05-22 00003 // 00004 // This script gets executed when double-clicking a ROOT file (currently only on Windows). 00005 // The file that got double clicked and opened is accessible as _file0. 00006 00007 void onBrowserClose() { 00008 gApplication->Terminate(0); 00009 } 00010 00011 void fileopen() 00012 { 00013 TBrowser *b = new TBrowser; 00014 // or, to only browse the file: 00015 // new TBrowser(_file0); 00016 00017 // Quit ROOT when the browser gets closed: 00018 b->GetBrowserImp()->GetMainFrame()->Connect("CloseWindow()", 0, 0, "onBrowserClose()"); 00019 }