00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include <TApplication.h>
00011 #include <TGClient.h>
00012 #include <TROOT.h>
00013 #include <TSystem.h>
00014 #include <TEnv.h>
00015 #include <TString.h>
00016 #include <TMath.h>
00017
00018 #include <TGFrame.h>
00019 #include <TGLayout.h>
00020 #include <TGFileDialog.h>
00021
00022 #include <iostream>
00023 #include <stdlib.h>
00024
00025 #include "BesVisClient/BesClient.h"
00026 #include "BesVisLib/BesVisDisplay.h"
00027
00028 using namespace std;
00029
00030
00031 int main(int argc, char **argv) {
00032
00033 printf("\nWELCOME to BES3 Event Display\n\n");
00034
00035 gEnv->SetValue("Gui.BackgroundColor", "#d6def7");
00036 gEnv->SetValue("Gui.SelectBackgroundColor", "#ffeec2");
00037 gEnv->SetValue("Gui.SelectForegroundColor", "black");
00038
00039 if (getenv("BESVISLIBROOT") == 0){
00040 setenv("BESVISLIBROOT", "/ihepbatch/bes/tianhl/workarea/630/EventDisplay/BesVisLib/BesVisLib-00-00-02", 1);
00041 }
00042 gEnv->SetValue("+Gui.IconPath", ":${BESVISLIBROOT}/icons");
00043
00044 TApplication theApp("App", &argc, argv);
00045
00046 if (gROOT->IsBatch()) {
00047 fprintf(stderr, "%s: cannot run in batch mode\n", argv[0]);
00048 return 1;
00049 }
00050
00051 int width = 800;
00052 int height = 500;
00053 BesClient client(gClient->GetRoot(), "BesVis", width, height, "", theApp.Argc(), theApp.Argv());
00054 try{
00055 theApp.Run();
00056 }
00057 catch (const char *s){
00058 std::cout << s << std::endl;
00059 }
00060
00061 return 0;
00062 }
00063