Diana Software
dianagui.cxx
Go to the documentation of this file.
1 #include "QGCanvasWindow.hh"
2 #include <TApplication.h>
3 #include <iostream>
4 #ifndef WIN32
5 #include "QGDMainFrame.hh"
6 #include <unistd.h>
7 #endif
8 #include <X11/Xlib.h>
9 
10 Int_t dianaGUIErrorHandler(Display *)
11 {
12  std::cout<<"X11 IO Error: DianaGUI died."<<std::endl;
13  return 0;
14 }
15 
16 int main(int argc, char **argv)
17 {
18 
19  TApplication *dianaGUI = new TApplication("Diana GUI", &argc, argv);
20  ::XSetIOErrorHandler(&dianaGUIErrorHandler);
21 #ifndef WIN32
22  const char valid_options[] = "d";
23  int c = ::getopt (argc, argv, valid_options);
24 
25  if(c == 'd') {
26  QGDMainFrame* f = new QGDMainFrame(gClient->GetRoot(),600,500);
27  dianaGUI->Run();
28  delete f;
29  } else {
30 #endif
31  new QGCanvasWindow();
32  dianaGUI->Run();
33 #ifndef WIN32
34  }
35 #endif
36 
37  return 0;
38 }
Window containing a ROOT canvas.
Main window of the interactive gui.
Definition: QGDMainFrame.hh:17
int main(int argc, char **argv)
Definition: dianagui.cxx:16
Int_t dianaGUIErrorHandler(Display *)
Definition: dianagui.cxx:10