TGText Buffer and GUI

Dear all,
I have a problem with TGTextBuffer and GUI.

I have a variable of the class OfflineMonitor
defined in OfflineMonitor.h as private:

TGTextBuffer *txtBuffer

Then the class has a method
void OfflineMonitor::Gui()

in which I do the following

txtBuffer = new TGTextBuffer(50);
entryRunNumber = new TGTextEntry(mainFrame, txtBuffer);

buttonRun = new TGTextButton(mainFrame, “Run”);

buttonRun->Connect(“Clicked()”, “OfflineMonitor”, this, “DoRun()” );

Now the method DoRun() is called correctly but the txtBuffer
variable is not defined anymore inside this method.

I have also tried with a different variable for example an int type variable
again defined in the OfflineMonitor.h as private, but again
this variable if assigned in Gui.cxx like txtBuffer (for example a variable int pippo = 12) when printed out in the DoRun() method is not correctly passed and the printout gives a random value.

The macro is correctly working when running under a linux machine with /include/c++/3.2.2 while it works in a strange way as described above when running in a linux machine with /include/c++/3.4.4.

Can somebody help me?

Thanks a lot


Hi Claudia,

Please send your code, or a short macro reproducing your problem, as I can’t really guess what’s going wrong in your code…
(if you prefer, you can send it directly to me: