Hi Rene, it's easy to fix by adding changes to SetOpt function void SetOpt(TObject* obj) { TObject* memobj = obj; if (obj->InheritsFrom(TKey::Class())) { memobj = ((TKey*)obj)->ReadObj(); } if (memobj && memobj->InheritsFrom(TH2::Class())) { ((TH2*)memobj)->SetOption("colz"); } } Regards. Valeriy > Hi Valeriy, > > Your technique does not work in case of browsing histograms in a file > (most frequent case). In this case obj is a TKey not a TH1. > > Rene > > On Sat, 20 Sep 2003, > Valeriy Onuchin wrote: > > > Hi Alexander > > 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*)"); > > > > mouse double click in any root browser will invoke SetOpt function > > > > That's all. > > > > Regards. Valeriy > > > > > > > Hi, > > > > > > in the TBrowser, I would like to click on a TH2 and have it drawn with > > > option 'colz' by default. I tried to edit the root.mimes but this did not > > > help. How can this be done? > > > > > > Thanks for your help. > > > > > > Alexander > > > > > > > > > >
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:15 MET