Re: TMapFile,TButton

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue May 11 1999 - 18:31:12 MEST


Thomas Eberl wrote:
> 
> Dear Rooters,
> 
> I have two questions:
> 
> -- I use TMapFile to work with shared memory (compiled prog). My goal is
> to have two producer processes that write into two different memory
> regions and one consumer that reads from both shared memory areas. I
> have read about SetMapAddress, but I am not sure how to use it here.
> How can I make them coexist ???
> 

Hi Thomas,
Fons will answer this part.

> -- I use TButton and its method SetMethod to interact with my program
> (compiled -- not a macro). My problem is that I can not access any
> variables through SetMethod that are declared in my program. I can
> declare new variables or execute macros (like I were in a CINT session),
> but I can not manipulate a variable from my program (error message: ...
> not in current scope). How can I fix this ??
> --

TButton::SetMethod expects a string that can be executed via the
interpreter.
Below, you will find an example (from Atlfast) illustrating how to call
class member functions with parameters. The string is passed to teh
constructor,
but it also applies to SetMethod.

Rene Brun

   TButton *button;
   char *but1 = "gATLFast->Display()->ShowNextEvent(1)";
   button = new TButton("Next",but1,x0,y-dbutton,x1,y);
   button->SetFillColor(38);
   button->Draw();

   y -= dbutton +dy;
   char *but2 = "gATLFast->Display()->ShowNextEvent(-1)";
   button = new TButton("Previous",but2,x0,y-dbutton,x1,y);
   button->SetFillColor(38);
   button->Draw();

   y -= dbutton +dy;
   char *but3 = "gATLFast->Display()->SetView(90,-90)";
   button = new TButton("Top View",but3,x0,y-dbutton,x1,y);
   button->SetFillColor(butcolor);
   button->Draw();

   y -= dbutton +dy;
   char *but4 = "gATLFast->Display()->SetView(90,0)";
   button = new TButton("Side View",but4,x0,y-dbutton,x1,y);
   button->SetFillColor(butcolor);
   button->Draw();

   y -= dbutton +dy;
   char *but5 = "gATLFast->Display()->SetView(0,-90)";
   button = new TButton("Front View",but5,x0,y-dbutton,x1,y);
   button->SetFillColor(butcolor);
   button->Draw();

   y -= dbutton +dy;
   char *but6 = "gATLFast->Display()->DrawAllViews()";
   button = new TButton("All Views",but6,x0,y-dbutton,x1,y);
   button->SetFillColor(butcolor);
   button->Draw();

   y -= dbutton +dy;
   char *but7 = "gATLFast->Display()->DrawViewGL()";
   button = new TButton("OpenGL",but7,x0,y-dbutton,x1,y);
   button->SetFillColor(38);
   button->Draw();

   y -= dbutton +dy;
   char *but8 = "gATLFast->Display()->DrawViewX3D()";
   button = new TButton("X3D",but8,x0,y-dbutton,x1,y);
   button->SetFillColor(38);
   button->Draw();



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