Re: how to display event counter?

Rene Brun (Rene.Brun@cern.ch)
Mon, 15 Feb 1999 17:08:26 +0000


Witold Przygoda wrote:
>
> Hi ROOTers,
>
> I have been trying different possibilities to realize
> displaying in my TCanvas window (or in TPad or whatever...)
> a kind of Event counter (exactly in the shape of a counter
> from web-page ;).
>
> I have loop like:
>
> for (int i = 0; i < 1000; i++) {
>
> ....
>
> and I would like let's say every 10-th event
> to display event number in one of TPads, i.e.
> updating TPaveLabel, like histograms are updated and displayed.
> I have trying but I failed...
>
> Remark: I wanted it in my macro (not compiled program).
>
> Thank you for help.
>
> Witek

Hi Witek,
You can use an object like TText, TPaveLabel, etc.
Draw this object once at a given position.
Edit the content of this object. For example if you have a TText *text,
text->SetTitle(newstring);
gPad->Modified();
gPad->Update(); //this is essential in a macro

Rene Brun