library: libCore #include "TBrowser.h"

# TBrowser

class description - source file - inheritance tree (.pdf)

## class TBrowser : public TNamed

| Inheritance Chart:

`TObject`

<-

`TNamed`

<-

`TBrowser`

        public:

                            TBrowser(const char* name = "Browser", const char* title = "ROOT Object Browser")
                            TBrowser(const char* name, const char* title, UInt_t width, UInt_t height)
                            TBrowser(const char* name, const char* title, Int_t x, Int_t y, UInt_t width, UInt_t height)
                            TBrowser(const char* name, TObject* obj, const char* title = "ROOT Object Browser")
                            TBrowser(const char* name, TObject* obj, const char* title, UInt_t width, UInt_t height)
                            TBrowser(const char* name, TObject* obj, const char* title, Int_t x, Int_t y, UInt_t width, UInt_t height)
                            TBrowser(const char* name, void* obj, TClass* cl, const char* objname = "", const char* title = "ROOT Foreign Browser")
                            TBrowser(const char* name, void* obj, TClass* cl, const char* objname, const char* title, UInt_t width, UInt_t height)
                            TBrowser(const char* name, void* obj, TClass* cl, const char* objname, const char* title, Int_t x, Int_t y, UInt_t width, UInt_t height)
                            TBrowser(const TBrowser&)
                    virtual ~TBrowser()
                       void Add(TObject* obj, const char* name = "0")
                       void Add(void* obj, TClass* cl, const char* name = "0")
             static TClass* Class()
               virtual void Create(TObject* obj = 0)
                       void ExecuteDefaultAction(TObject* obj)
               TBrowserImp* GetBrowserImp() const
              TContextMenu* GetContextMenu() const
          virtual Option_t* GetDrawOption() const
                     Bool_t GetRefreshFlag() const
                   TObject* GetSelected() const
                       void Iconify()
            virtual TClass* IsA() const
                  TBrowser& operator=(const TBrowser&)
               virtual void RecursiveRemove(TObject* obj)
                       void Refresh()
               virtual void SetDrawOption(Option_t* option = "")
                       void SetRefreshFlag(Bool_t flag)
                       void SetSelected(TObject* clickedObject)
                       void Show()
               virtual void ShowMembers(TMemberInspector& insp, char* parent)
               virtual void Streamer(TBuffer& b)
                       void StreamerNVirtual(TBuffer& b)

### Data Members

        private:

          TObject* fLastSelectedObject  !The last TObject selected by user

        protected:

            TBrowserImp* fImp          !Window system specific browser implementation
          TBrowserTimer* fTimer        !Browser's timer
           TContextMenu* fContextMenu  !Context menu pointer
                  Bool_t fNeedRefresh  True if the browser needs refresh

        public:

          static const enum TBrowser:: kNoHidden

## Class Description

     Using a TBrowser one can browse all ROOT objects. It shows in a list
     on the left side of the window all browsable ROOT classes. Selecting
     one of the classes displays, in the iconbox on the right side, all
     objects in the class. Selecting one of the objects in the iconbox,
     will place all browsable objects in a new list and draws the
     contents of the selected class in the iconbox. And so on....

TBrowser(const char *name, const char *title) : TNamed(name, title), fLastSelectedObject(0), fTimer(0), fContextMenu(0), fNeedRefresh(kFALSE)

     Create a new browser with a name, title. Width and height are by
     default set to 640x400 and (optionally) adjusted by the screen factor
     (depending on Rint.Canvas.UseScreenFactor to be true or false, default
     is true).

TBrowser(const char *name, const char *title, UInt_t width, UInt_t height) : TNamed(name, title), fLastSelectedObject(0), fTimer(0), fContextMenu(0), fNeedRefresh(kFALSE)

     Create a new browser with a name, title, width and height.

TBrowser(const char *name, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height) : TNamed(name, title), fLastSelectedObject(0), fTimer(0), fContextMenu(0), fNeedRefresh(kFALSE)

     Create a new browser with a name, title, position, width and height.

TBrowser(const char *name, TObject *obj, const char *title) : TNamed(name, title), fLastSelectedObject(0), fTimer(0), fContextMenu(0), fNeedRefresh(kFALSE)

     Create a new browser with a name, title, width and height for TObject *obj.

TBrowser(const char *name, TObject *obj, const char *title, UInt_t width, UInt_t height) : TNamed(name, title), fLastSelectedObject(0), fTimer(0), fContextMenu(0), fNeedRefresh(kFALSE)

     Create a new browser with a name, title, width and height for TObject *obj.

TBrowser(const char *name, TObject *obj, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height) : TNamed(name, title), fLastSelectedObject(0), fTimer(0), fContextMenu(0), fNeedRefresh(kFALSE)

     Create a new browser with a name, title, width and height for TObject *obj.

TBrowser(const char *name, void *obj, TClass *cl, const char *objname, const char *title) : TNamed(name, title), fLastSelectedObject(0), fTimer(0), fContextMenu(0), fNeedRefresh(kFALSE)

     Create a new browser with a name, title, width and height for TObject *obj.

TBrowser(const char *name, void *obj, TClass *cl, const char *objname, const char *title, UInt_t width, UInt_t height) : TNamed(name, title), fLastSelectedObject(0), fTimer(0), fContextMenu(0), fNeedRefresh(kFALSE)

     Create a new browser with a name, title, width and height for TObject *obj.

TBrowser(const char *name,void *obj, TClass *cl, const char *objname, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height) : TNamed(name, title), fLastSelectedObject(0), fTimer(0), fContextMenu(0), fNeedRefresh(kFALSE)

     Create a new browser with a name, title, width and height for TObject *obj.

~TBrowser()

     Delete the browser.

void Add(TObject *obj, const char *name)

     Add object with name to browser. If name not set the objects GetName()
     is used.

void Add(void *obj, TClass *cl, const char *name)

     Add foreign object with name to browser.
     'cl' is the type use to store the value of obj.
     So literally the following pseudo code should be correct:
        `cl->GetName()` * ptr = (`cl->GetName()`*) obj;
     and the value of obj is not necessarily the start of the object.

void Create(TObject *obj)

     Create the browser, called by the ctors.

void ExecuteDefaultAction(TObject *obj)

     Execute default action for selected object (action is specified
     in the $HOME/.root.mimes or $ROOTSYS/etc/root.mimes file.

void RecursiveRemove(TObject *obj)

     Recursively remove obj from browser.

void Refresh()

     Refresh browser contents.

void SetSelected(TObject *clickedObject)

     Assign the last selected object.

### Inline Functions

             TBrowserImp* GetBrowserImp() const
            TContextMenu* GetContextMenu() const
                   Bool_t GetRefreshFlag() const
                 TObject* GetSelected() const
                     void SetRefreshFlag(Bool_t flag)
                     void Iconify()
                     void Show()
                     void SetDrawOption(Option_t* option = "")
                Option_t* GetDrawOption() const
                  TClass* Class()
                  TClass* IsA() const
                     void ShowMembers(TMemberInspector& insp, char* parent)
                     void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)
                 TBrowser TBrowser(const TBrowser&)
                TBrowser& operator=(const TBrowser&)

Author: Fons Rademakers 25/10/95
Last update: root/base:$Name: $:$Id: TBrowser.cxx,v 1.13 2005/06/23 06:24:27 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *