Re: [ROOT] TButton push eats macro variables

From: dfaden@iastate.edu
Date: Tue Jun 12 2001 - 20:29:33 MEST


Hi,
   Sorry I was not clearer in my original post.
   I do not want to access one macro's variables from another macro. My 
problem is this: a macro calls compiled code, which displays a TButton; 
the macro continues to run while the TButton is displayed; but when the user 
clicks on the TButton, apparently all of the macro's variable definitions 
are erased, and ROOT exits the macro complaining of undefined 
variables -- variables defined previously in that macro.
   The interpreted code attached to the TButton is used to hook up the 
TButton to other parts of the compiled code using the same technique as 
demoed in $ROOTSYS/tutorials/dialogs.C. I don't believe the TButton's 
command contains anything that should be affecting the macro. (No 
gROOT->Reset().)
   I have not been able to reproduce this problem in simpler test cases.
   This problem is showing up under ROOT Version 3.01/05 7 June 
2001 under Red Hat Linux 6.1 on an i386.
   Thank you.

David


> Hi David,
> 
> The variable in a macro must be a global variable if you want to access it
> inside another macro.
> Also make sure that you do not have gROOT->Reset() at the beginning
> of your second macro. This will erase all CINT global variables
> definitions.
> 
> Rene Brun
> 



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:49 MET