void stbar(TCanvas *c1)
{
// show status bar
c1->ToggleEventStatus();
// gui implementation of the canvas
TRootCanvas *rc = (TRootCanvas*)c1->GetCanvasImp();
// get pointer to canvas's status bar
TGStatusBar *bar = rc->GetStatusBar();
// add a new part to the status bar
bar->SetParts(5);
// Put some text into the new part (numbering starts from 0)
bar->SetText("Hello world!", 4);
}
Completely means completely.
I want to switch off code in TCanvas::DrawEventStatus and
use status bar in completely different way including different number of parts
(less then 4 as in default canvas)
Please find attached an example that does what Valeriy suggested - it creates an embeded canvas and a status bar as one TCanvas has. I have commented the code of lines 103 and 105 and wrote another text for 1st and 2nd fields of the status bar, leaving 3rd and 4th to display the same information as event status bar of canvas.