evdb.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 #include "nutools/EventDisplayBase/evdb.h"
3 #include <cstdlib>
4 #include <string>
5 // ROOT includes
6 #include "TGClient.h"
7 #include "TGFrame.h"
8 #include "TGPicture.h"
9 
10 //......................................................................
11 
12 const TGWindow* evdb::TopWindow() { return gClient->GetRoot(); }
13 
14 //......................................................................
15 
16 TGPicturePool* evdb::PicturePool()
17 {
18  static TGPicturePool* pp = 0;
19  if (pp==0) {
20  std::string path;
21 
22  const char* private_ctx = getenv("SRT_PRIVATE_CONTEXT");
23  const char* public_ctx = getenv("SRT_PUBLIC_CONTEXT");
24  const char* root_ctx = getenv("ROOTSYS");
25 
26  // Not every experiment uses SRT, so check that the SRT environmental
27  // variables are legit before adding them to the path
28  if(private_ctx) { path += private_ctx; path += "/EventDisplay/icons:"; }
29  if(public_ctx) { path += public_ctx; path += "/EventDisplay/icons:"; }
30  path += root_ctx; path += "/icons";
31 
32  pp = new TGPicturePool(gClient, path.c_str());
33  }
34  return pp;
35 }
36 ////////////////////////////////////////////////////////////////////////
std::string string
Definition: nybbler.cc:12
std::string getenv(std::string const &name)
Definition: getenv.cc:15
const TGWindow * TopWindow()
Definition: evdb.cxx:12
TGPicturePool * PicturePool()
Definition: evdb.cxx:16