Subclassing TApplication?

I am developing a ROOT application where the command input comes from the shell. The application is put into the background and joins the shell’s process group. My earlier post concerning signal handling in general is related to this. Because I wanted the application to able to trap SIGHUP when the shell exits. The application is working quite well, but I have now encountered a problem which may require a redesign. Perhaps, subclassing TApplication?? The problem is this:

In order to draw histograms in canvases, I instantiate TApplication. But I do not call Run(), because I want to be in control of the command loop. However, by not calling Run(), I have lost Notify events to redraw the canvas when it is exposed or resized. So, the question is: how do I can get access to these notifications? I see that events in TApplication are handled by TSystem. Is it possible to bypass TApplication::Run() and work directly with TSystem? Or, would it be easier to subclass TApplication? I could thread the program, translate the command strings and call TApplication’s ProcessLine().

I would appreciate any advice you may have on how I should proceed and which source files to look at for help and inspiration.

Thanks in advance!!


Hi Ken,

you will have to call gSystem->ProcessEvents() at regular intervals, could be driven from a timer by your event loop. Calling ProcessEvents() will process the pending X11, socket and file events as well as any ROOT timers.

Cheers, Fons.