Re: PAW's equivalent text x y [headstring] size

Rene Brun (Rene.Brun@cern.ch)
Mon, 05 Jan 1998 17:39:07 +0100


Dirk Meier wrote:

> Hello,
>
> how do I translate the following PAW syntax to root?
>
> rn = 523
> headstring = "Run Number: "//[rn]//" and other numbers"
> text 3 5 [headstring] 0.5
>
> e.g. TText expects a Text_t argument, so I would
> convert the number into a string (TString?) and
> concatenate...
> Is there an easy way to do this (also for floats).
>
> Dirk

Use sprintf. Example
char headstring[100];
sprintf(headstring,"Run number %d",rn);
TText *text = new TText(3,5,headstring);
text->Draw();

Rene Brun