Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use TROOT::GetIconPath instead of $ROOTSYS/icons #1190

Merged
merged 1 commit into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions DDEve/src/Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "DD4hep/Printout.h"

// ROOT include files
#include "TROOT.h"
#include "TH2.h"
#include "TFile.h"
#include "TSystem.h"
Expand Down Expand Up @@ -270,7 +271,11 @@ void Display::UnregisterEvents(View* view) {

/// Open standard message box
void Display::MessageBox(PrintLevel level, const string& text, const string& title) const {
#if ROOT_VERSION_CODE >= ROOT_VERSION(6,9,2)
string path = TString::Format("%s/", TROOT::GetIconPath().Data()).Data();
#else
string path = TString::Format("%s/icons/", gSystem->Getenv("ROOTSYS")).Data();
#endif
const TGPicture* pic = 0;
if ( level == VERBOSE )
pic = client().GetPicture((path+"mb_asterisk_s.xpm").c_str());
Expand Down
5 changes: 5 additions & 0 deletions DDEve/src/EventControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "DD4hep/InstanceCount.h"

// ROOT include files
#include <TROOT.h>
#include <TSystem.h>
#include <TGTab.h>
#include <TGLabel.h>
Expand Down Expand Up @@ -158,7 +159,11 @@ void EventControl::OnNewEvent(EventHandler& handler) {

/// User callback to add elements to the control
void EventControl::OnBuild() {
#if ROOT_VERSION_CODE >= ROOT_VERSION(6,9,2)
string icondir = TString::Format("%s/", TROOT::GetIconPath().Data()).Data();
#else
string icondir = TString::Format("%s/icons/", gSystem->Getenv("ROOTSYS")).Data();
#endif
TGGroupFrame* group = new TGGroupFrame(m_frame,"Event I/O Control");
TGCompositeFrame* top = new TGHorizontalFrame(group);
TGPictureButton* b = 0;
Expand Down
9 changes: 9 additions & 0 deletions DDEve/src/GenericEventHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <stdexcept>

/// ROOT include files
#include "TROOT.h"
#include "TGMsgBox.h"
#include "TSystem.h"
#include <climits>
Expand Down Expand Up @@ -136,7 +137,11 @@ bool GenericEventHandler::Open(const string& file_type, const string& file_name)
err = "\nAn exception occurred \n"
"while opening event data:\n" + string(e.what()) + "\n\n";
}
#if ROOT_VERSION_CODE >= ROOT_VERSION(6,9,2)
string path = TString::Format("%s/stop_t.xpm", TROOT::GetIconPath().Data()).Data();
#else
string path = TString::Format("%s/icons/stop_t.xpm", gSystem->Getenv("ROOTSYS")).Data();
#endif
const TGPicture* pic = gClient->GetPicture(path.c_str());
new TGMsgBox(gClient->GetRoot(),0,"Failed to open event data",err.c_str(),pic,
kMBDismiss,0,kVerticalFrame,kTextLeft|kTextCenterY);
Expand All @@ -157,7 +162,11 @@ bool GenericEventHandler::NextEvent() {
throw runtime_error("+++ EventHandler::readEvent: No file open!");
}
catch(const exception& e) {
#if ROOT_VERSION_CODE >= ROOT_VERSION(6,9,2)
string path = TString::Format("%s/stop_t.xpm", TROOT::GetIconPath().Data()).Data();
#else
string path = TString::Format("%s/icons/stop_t.xpm", gSystem->Getenv("ROOTSYS")).Data();
#endif
string err = "\nAn exception occurred \n"
"while reading a new event:\n" + string(e.what()) + "\n\n";
const TGPicture* pic = gClient->GetPicture(path.c_str());
Expand Down
5 changes: 5 additions & 0 deletions UtilityApps/src/teve_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "run_plugin.h"
#include "TRint.h"

#include "TROOT.h"
#include "TEveGeoNode.h"
#include "TEveBrowser.h"
#include "TGNumberEntry.h"
Expand Down Expand Up @@ -282,7 +283,11 @@ void make_gui() {
TGHorizontalFrame* hf = new TGHorizontalFrame(frmMain);
{

#if ROOT_VERSION_CODE >= ROOT_VERSION(6,9,2)
TString icondir( Form("%s/", TROOT::GetIconPath().Data()) );
#else
TString icondir( Form("%s/icons/", gSystem->Getenv("ROOTSYS")) );
#endif
TGPictureButton* b = 0;
EvNavHandler *fh = new EvNavHandler;

Expand Down
Loading