Re: [ROOT] How to make colz default for TBrowser?

From: Valeriy Onuchin (Valeri.Onoutchine@cern.ch)
Date: Wed Sep 24 2003 - 10:24:51 MEST


 Hi Alexander,
no QtRoot required. It's standard ROOT.
I attached macro which allows to do more funny things
while browsing. 
  - set "colz" option for TH2 histogram
  - zoom TH2 histogram
  - it works OK with histograms located in ROOT files
 
To test it:

  - load it
    root[].L tst.C
  - make class signal-slot connection
    root[] TQObject::Connect("TRootBrowser","DoubleClicked(TObject*)",0,0,"Zoom(TObject*)");
 - run ROOT browser and browse hsimple.root file from tutorials directory.
 - double click on hpxy histogram

I would like to add that using "class signal-slot " connections is
equivalent to overloading class method without recompiling.

Regards. Valeriy

> Hi Valeriy,
> 
> > it can be done with a trick using signal-slots:
> >  - create macro (e.g. tst.C) containing the following function:
> >
> > void SetOpt(TObject* obj)
> > {
> >    if (obj->InheritsFrom(TH2::Class())) {
> >       ((TH2*)obj)->SetOption("colz");
> >    }
> > }
> >
> >   - load it
> >   root[].L tst.C
> >  - make class signal-slot connection
> >   root[] TQObject::Connect("TRootBrowser","DoubleClicked(TObject*)",0,0,"SetOpt(TObject*)");
> 
> This somehow does not work. I have the impression that QtROOT is required
> which I do not (yet) have.  Anyway, the solution Rene suggested is working
> very well.
> 
> Alexander
> 
> 





This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:15 MET