Re: How do I make my object "browsable"

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Tue, 25 Mar 2008 12:13:59 +0100


Hi Tobias,

you'll need to re-implement Browse(TBrowser* b). Check e.g. TBranch's version which shows a basic example:
<http://root.cern.ch/root/html/src/TBranch.cxx.html#pV16>

Let us know if you need a bit more details.

Cheers, Axel.

On 2008-03-25 11:51, Tobias Raufer wrote:
>
>
> Dear roottalk,
>
> I have a simple class which inherits from TObject. Its data members are
> a few ints and doubles and a TClonesArray. I write objects of this type
> to a TFile.
>
> Is there a way to make this class "browsable" in the TBrowser? I'd like
> to be able to click on the object in the TBrowser and inspect its data
> members. I read in the User's Guide that I have to override the method
> "IsFolder()" to return true. I've done this but it doesn't seem to be
> enough.
>
> Do I have to implement my own Browse() method? When I stick my object
> into the branch of a TTree, I can browse it's contents. However, I want
> to avoid using a TTree and just save it to the TFile directly.
>
> Thanks for your help,
>
> Tobi
>
> P.S. My system info: Mac OS X 10.4, Root v5.17/03
>
>
> ---
> Tobias Raufer
>
> R1,2.90, RAL
> Chilton, Didcot
> OX11 0QX, UK
> +44 1235 778842
> +44 1235 446733 (fax)
> t.m.raufer_at_rl.ac.uk
>
Received on Tue Mar 25 2008 - 12:14:13 CET

This archive was generated by hypermail 2.2.0 : Tue Mar 25 2008 - 17:50:01 CET