Skip to content
Snippets Groups Projects
Commit 2d10e1d6 authored by Fons Rademakers's avatar Fons Rademakers
Browse files

don't create browser imp when default ctor is called via TClass::New().

Like for TCanvas.


git-svn-id: http://root.cern.ch/svn/root/trunk@5947 27541ba8-7e3a-0410-8455-c3a389f83636
parent f739a1e6
Branches
Tags
No related merge requests found
// @(#)root/base:$Name: $:$Id: TBrowser.h,v 1.7 2002/09/18 12:21:03 rdm Exp $
// @(#)root/base:$Name: $:$Id: TBrowser.h,v 1.8 2002/09/18 13:12:58 rdm Exp $
// Author: Fons Rademakers 25/10/95
/*************************************************************************
......@@ -41,12 +41,12 @@ class TBrowserTimer;
class TBrowser : public TNamed {
private:
TObject *fLastSelectedObject; //The last TObject selected by user
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
TBrowserTimer *fTimer; //!Browser's timer
TContextMenu *fContextMenu; //!Context menu pointer
Bool_t fNeedRefresh; //True if the browser needs refresh
public:
......
// @(#)root/base:$Name: $:$Id: TBrowser.cxx,v 1.8 2002/01/29 07:32:31 brun Exp $
// @(#)root/base:$Name: $:$Id: TBrowser.cxx,v 1.9 2002/01/30 11:02:22 rdm Exp $
// Author: Fons Rademakers 25/10/95
/*************************************************************************
......@@ -63,12 +63,16 @@ TBrowser::TBrowser(const char *name, const char *title)
// (depending on Rint.Canvas.UseScreenFactor to be true or false, default
// is true).
Float_t cx = gStyle->GetScreenFactor();
UInt_t w = UInt_t(cx*640);
UInt_t h = UInt_t(cx*400);
if (TClass::IsCallingNew()) {
fImp = 0;
} else {
Float_t cx = gStyle->GetScreenFactor();
UInt_t w = UInt_t(cx*640);
UInt_t h = UInt_t(cx*400);
fImp = gGuiFactory->CreateBrowserImp(this, title, w, h);
Create();
fImp = gGuiFactory->CreateBrowserImp(this, title, w, h);
Create();
}
}
//______________________________________________________________________________
......@@ -175,9 +179,10 @@ void TBrowser::Create(TObject *obj)
if (obj) {
Add(obj);
if (fImp) fImp->BrowseObj(obj);
}
// Fill the first list with all browsable classes from TROOT
else if (fImp) fImp->BrowseObj(gROOT);
} else if (fImp)
// Fill the first list with all browsable classes from TROOT
fImp->BrowseObj(gROOT);
// The first list will be filled by TWin32BrowserImp ctor
// with all browsable classes from TROOT
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment