[ROOT] Treeview does not return any response.

From: Harufumi TSUCHIYA (harufumi@icrr.u-tokyo.ac.jp)
Date: Wed Nov 06 2002 - 07:24:50 MET


Heloo ROOTers !

Yesterday(Nov 5th), I updated my ROOT(3.03.09) via cvs.
and I tried to use my program which is attached this mail.

I always compailed the program by the following,
g++ TreeView.cpp -o ../bin/TreeView -O2 -Wall `root-config --cflags --glibs`
and run
'TreeView -f myroot.root'.

Although treeviwer appeared on display, I could not
click any item in treeviwer. 
Before updating ROOT via cvs, I could click any item in the treeview and
get canvas drawn the data.

Please give me any idea.

Harufumi Tsuchiya.

g++ -v
Using builtin specs.
gcc version 2.95.3 20010315 (release) [FreeBSD]

FreeBSD 4.6.2-RELEASE




#include <TROOT.h>
#include <TTree.h>
#include <TFile.h>
#include <TRint.h>
#include <iostream.h>
void usage(Char_t*);
int main (int argc, char** argv) {
  // Get options //
  Char_t *treename = "tree";
  Char_t *rootfile = NULL;
  for ( Int_t i = 1; i < argc; i++ ) {
    if ( !strcmp(argv[i], "-t") ) {
      treename = argv[i+1];
    }
    else if ( !strcmp(argv[i], "-f") ) {
      rootfile = argv[i+1];
    }
    else if ( !strcmp(argv[i], "-h") ) {
      usage(argv[0]);
      exit(0);
    }
  }
  if ( rootfile == NULL ) {
    cout << "Please specify ROOT file using option '-f' " << endl;
    usage(argv[0]);
    exit(0);
  }
  TRint *app = new TRint("app", &argc, argv);
  // Open ROOT file //
  TFile *f = new TFile(rootfile);
  // Get Tree //
  TTree *t = (TTree*)f->Get(treename);
  // Start tree viewer //
  t->StartViewer();

  app->ClearInputFiles();
  app->Run();

  return 0;
}

void usage(Char_t *progname) {
  cout << "Usage : " << progname << " -f <rootfile> [-t <treename>] " << endl;
}



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:16 MET