Re: kButtonX processing, Root 2.23/10, WinNT 4

From: Valeri Fine (Faine) (fine@bnl.gov)
Date: Sat Jan 08 2000 - 01:08:07 MET


> 
> >    Also which class could/should I use to display such a dialog window with
> > a few (five is my present need) edit boxes and some static labels in my
> > program?

  You can try macro as follows.
  it is a fragile but may be this helps somehow.

------------  Cut here -----------------
{
  // select an arbitrary method of the arbitrary class

   TH1 *f = new TH1F("ggg","aaa",10,2,3);
   TObject *obj = (TObject *)f;
   TClass *cl   = obj->IsA();
   TMethod *method = 0; 
   TIter    next(cl->GetListOfMethods());
   while ((method = (TMethod *) next())) { 
      if (strcmp("AddBinContent", method->GetName()) == 0) break;
      printf(" %s \n", method->GetName());
   }

  // Create a dialog to call that method  
   if (method) {
     printf(" %s \n", method->GetName());
     TContextMenu *menu =  new TContextMenu("Dialog","my");
     TCanvas *c1 = new TCanvas("c1"); // We need some canvas since Dialog is a child of Canvas
     menu->SetCanvas(c1);
     TContextMenuImp *imp = menu->GetContextMenuImp();
     imp->DisplayPopup ( 1,1 );
     menu->Action(obj,method);
   }
}
------------  Cut here -----------------

  It needs no GUI class and should work for either platform.  

    Valery 



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:16 MET