Re: [ROOT] canvas created but not drawn ...

From: Jacek M. Holeczek (holeczek@us.edu.pl)
Date: Sun Apr 13 2003 - 14:56:51 MEST


Hi,
Many thanks for your help.

> This requires a TApplication, but not a TApplication::Run

The clear message then is that IT IS REQUIRED to create a TApplication in
case one wants to get any graphics on the screen.
Thus, immediately before the line "new TCanvas(...)" I put :
	if (!gApplication) new TApplication("Application", ((int *)0), ((char **)0));
and this seems to solve the problem (I mean, I get my canvas drawn).
There is one additional warning - it looks like certain root actions have
a side-effect of creating a batch-TApplication object, if the gApplication
is null. There doesn't seem to be any way to switch such an application
into a non-batch mode (at least "gROOT->SetBatch(kFALSE);" doesn't work at
all). And ... the "new TCanvas(...)" is one of such actions !!! Thus
... first "new TApplication(...)", and then "new TCanvas(...)". Never
opposite !!!

Best regards,
Jacek.



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:10 MET