int main(int argc, char **argv)
{
(...)
TApplication theApp("theApp", &argc, argv) ;
(... my program)
theApp.Run();
return 0;
} // main
When I launch the program a few canvas are displayed and usually I just quit using File->Quit ROOT in one of the canvas, How could I do it automatically ?
Thanks a lot in advance that may save me a lot of time !!!
Sorry, but when you create a TApplication, you have to control it, there is no “automatic termination”…
(i.e. you may choose to terminate when there are no more open windows, no more input/output, no more open file, …)
Ok then, but I think there should have such a thing, or am I just using the wrong class ?
Because when creating lots of batches of canvas using some code which has been quite improved I don’t see the point to stand in front of the screen just to quit at the ned of each batch.
Please try the attached demo app. It creates three canvases, save them in gif format and then exit.
Cheers,
Bertrand.[/quote]
Just a very silly comment
It doesn’t matter too much what you call a source file, but make sure you don’t name the executable ‘test’. If you have ‘.’ in your path people usually just type
unix> test
And your code won’t run (you’ll run the unix command ‘test’ instead which appears to do nothing). Many people have lost many hours because of this.
int main(int argc, char **argv)
{
(...)
TApplication theApp("theApp", &argc, argv) ;
(... my program)
theApp.Run();
return 0;
} // main
[/quote]Can you give us an example what your (... my program)does ? Probably you do not need to call theApp.Run(); at all. May be, what you need can be done with the simple ROOT session:root.exe -q <you program>With the information your have provided it is hard to make an advice.