Re: [ROOT] *TOGGLE*

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Fri Mar 12 2004 - 03:37:59 MET


Hi Thomas,

  I've added support for *TOGGLE* without the need for a matching data
member. To do what you want see this piece of cvs log:

add support for *TOGGLE* context menu methods that are not related to a
data member with the same name (e.g. a method that changes a bit in a
data member with a different name). For these methods one can add the
comment option:

*GETTER=<getter-method>

to say what the getter method to use, like:

void SetNoExponent(Bool_t noex=kTRUE); //*TOGGLE* *GETTER=GetNoExponent

So in your case:

void SetMyBit(Bool_t b) { ...; } //*TOGGLE* *GETTER=IsMyBit

should do the trick.


Cheers, Fons.



> Hi all,
>
> why does this functionality need a existing data-member, eg
> Bool_t fMyBit;
>
> Isn't it enough if the corresponding Set, Get/Is functions are 
> available, eg:
> void SetMyBit(Bool_t b) { b ? SetBit(1<<14) : ResetBit(1<<14); } >
//*TOGGLE*
> Bool_t IsMyBit() const { return TestBit(1<<14); }
>
> Best regards,
> Thomas.
-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://www.rademakers.org/fons/      Fax:   +41 22 7679480



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