Re: [ROOT] TRootBrowser

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Feb 06 2004 - 17:18:53 MET


Hi Alexander,

I do not understand why you need a new class.
If you simply create the following standard program, you will get what you want.
To exit from the application, select the "Quit Root" item in the
browser "File" menu.

//file browse.cxx
#include <TApplication.h>
#include <TBrowser.h>
#include <TFile.h>

int main(int argc, char* argv[])
{
    TApplication app("rootbrowse", &argc, argv);
    for( int i=1; i<app.Argc(); ++i )
        new TFile( app.Argv(i) );
    new TBrowser;
    app.Run();
    return 0;
}

on Linux, do:
g++ -o browse browse.cxx `root-config --cflags --glibs`

to use it, do
browse file1.root file2.root    fileN.root

Rene Brun

Alexander Bürger wrote:
> 
> Dear rooters,
> 
> when receiving root files via email I would like to have a quick way to
> see them. I wrote a small program which is attached. It tries to load
> everything given on the command line as a root file and then opens a
> TBrowser. There is a little problem: I want the program to terminate when
> I close the browser window, so I subclassed TRootBrowser, and, to make it
> used, also TBrowser. This leads to a flashing at startup as the TBrowser
> creates a TRootBrowser first which is then deleted and replaced by the
> MyRootBrowser. Any ideas how to avoid this flashing, or how to avoid the
> subclassing of TRootBrowser?
> 
> Alexander
> 
>   --------------------------------------------------------------------------------
>                      Name: rootbrowse.cxx
>    rootbrowse.cxx    Type: TEXT/x-c++src
>                  Encoding: BASE64



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:05 MET