Controlbar menu

From: Jayoung Wu (jayoung@ipst.umd.edu)
Date: Fri Mar 27 1998 - 19:02:57 MET


Hi,
Can a Controlbar menu execute a file("ytrack.C") which include a
function("sfit") in the file?

-------------- demos.C ---------------------------------
{
  gROOT->Reset("a");
  bar = new TControlBar("vertical","main menu");
  bar1 = new TControlBar("horizontal","Event Change","Pop up
                                     event change menu bar");
  bar2 = new TControlBar("horizontal","Tracking",
                                     "Pop up tracking menu bar");

  bar->AddButton("Start!",".x start.C", "Read 1st event from
aticdata.root");
  bar->AddControlBar(bar1);
  bar->AddControlBar(bar2);

  bar1->AddButton("Event++",".x nextevent.C", "Next Event read");
  bar2->AddButton("Track Y", ".x ytrack.C", "Tracking Incident Y
Possition");
                  
  bar->Show();
  gROOT->SaveContext();

}
--------------------------------------------------------------------

----------- ytrack.C -------------------------
void sfit(Int_t n,Float_t *x,Float_t *y,Float_t *w,Float_t *pb0,Float_t
*pb1);
void sfit(Int_t n,Float_t *x,Float_t *y,Float_t *w,Float_t *pb0,Float_t
*pb1)
{
    ......... definition of "sfit" function goes here .....
}
 
void ytrack()
{
   ..........

   call "sfit" function
   ........
}
---------------------------------------------------------
When I execute "start.C" or "nextevent.C" which has no funtion I had no
problem with Controlbar menu. However, When I execute "ytrack.C" I got
sigmentation violation. Is this because "ytrack.C" include a funtion?

Without using Controlbar menu, I successfuly execute "ytrack.C" macro.
                  
---
Thanks,
Jayoung
 



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