Standalone Code, scope, TControlBar

From: Jon Gans (gans@star.physics.yale.edu)
Date: Mon Aug 02 1999 - 17:26:45 MEST


After fixing all GUI stuff, I find the variables do not stay in scope in
the controlbar. for example, with the following code, I get this error
when the Test button is pressed:
	Error: No symbol x in current scope  FILE:/tmp/27101aaa_cint LINE:1

here is the code:

#ifndef __CINT__
#include <iostream.h>
#include "TROOT.h"
#include "TRint.h"
#include "TControlBar.h"
#include "TApplication.h"
#endif

extern void InitGui();
VoidFuncPtr_t initfuncs[] = { InitGui, 0 };

TROOT root("richView", "Rich Viewer",initfuncs);

int main(int argc, char **argv)
{

  TApplication * theApp = new TApplication("RichEvent", &argc, argv);
  // TRint * theApp = new TRint("RichEvent",&argc,argv,0,0);
  
  int x = 10;
 
 TControlBar bar("vertical");
 bar.AddButton("Test", "x++;", "test");
 bar.Show();

  theApp->Run();
  return 0;
}

moreover, if i switch to TRint instead of TApplication i get:
undefined reference to `TRint::TRint(char *, int *, char **, void *, int)'

I know TRint.h is included because if i comment out the include line a get
many more errors.

I am on Linux 5.2 running Root 2.22/10

 thanks alot
 jon

______________________________________________________________________________

Jonathan Gans					   Home: 516 344 1265
Brookhaven National Lab                            Work: 516 344 7405	
Building 902b, Room 11                   Fax/Voice Mail: 516 213 4967 (LI)
Upton, NY 11973                            (Via Email)   718 247 2926 (NYC)
		http://star.physics.yale.edu/users/gans



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:37 MET