Re: [ROOT] TRootBrowser

From: Bertrand Bellenot (bellenot_b@bluewin.ch)
Date: Sun Feb 08 2004 - 16:48:45 MET


Hi Alexander,

Here is the code I use in association with root files, allowing
to browse them with mouse's double-click.

#include "TApplication.h"
#include "TSystem.h"
#include "TFile.h"
#include "TBrowser.h"

class RBrowser : public TBrowser {

public:

    RBrowser();
    ~RBrowser();
};

RBrowser::RBrowser() : TBrowser()
{
}

RBrowser::~RBrowser()
{
    // exit on close window
    delete this;
    gApplication->Terminate();
}

int main(int argc, char **argv)
{
    if(argc > 1) {
        for(int i=1; i<argc; i++ )
            new TFile( argv[i], "READ" );
    }
    TApplication theApp("rbrowser", &argc, argv);
    gSystem->Load("libTreeViewer");
    new RBrowser();
    theApp.Run();
    return 0;
}

Hope it helps.
Cheers,
Bertrand.


----- Original Message -----
From: "Alexander Bürger" <buerger@iskp.uni-bonn.de>
To: <roottalk@pcroot.cern.ch>
Sent: Sunday, February 08, 2004 3:23 PM
Subject: Re: [ROOT] TRootBrowser


> Hi Rene,
>
> > To exit from the application, select the "Quit Root" item in the
> > browser "File" menu.
>
> This is the point. I find it much more convenient if the application
> exits also when I close the window via the windowmanager because I know
> I would often forget to "Quit ROOT". The aim is to put it into .mailcap,
> so I cannot just stop the application with Ctrl-C when it's run e.g.
> from mozilla.
>
> Best wishes,
>
> Alexander
>



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