Re: [ROOT] adding commands to root

From: Valeriy Onuchin (Valeri.Onoutchine@cern.ch)
Date: Thu Sep 23 2004 - 19:34:17 MEST


 H,i 
another solution, which does not required Rint overloading -
 use TApplication::ReturnPressed(char *text ) signal
and connect it some handler function which will detect
".hac filename" and process it.

Regards. Valeriy

++
 Off-topic: Alex, I remeber your message about adding separator to
ROOT control bar. Check  notes of coming (really soon) release ;-)   

> > Hello all
> >
> > Is there any way of adding commands (like .L or similar)
> > to root? I mean, I am creating a stand alone application that
> > has a command line interface and I would like to create a few
> > commands. I can create functions but I feel it would be easier
> > to have something like
> >
> > .hac filename
> >
> > instead of
> >
> > hac("filename")
> 
> Hi Alex,
> you could inherit from TRint and overwrite the method
> 
> YourClass::ProcessLine(const char *line, Bool_t sync,int *err )
> {
>  if(line starts with ".hac"){
>    myaction();
>  } else {
>    TRint::ProcessLine(line, sync, err);
>  }
> }
> 
> Cheers
> 
> Gero
> 
> 



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET