I’m not sure if this is the place to post this question, but I’m going to anyway.
I have a gui that I use to basically provide input to a separate application. I take the information from the widgets and start the executable (with the options from the widgets) by using gSystem->Exec(). This allows me to have the gui still active and have the program run in the background. Once this happens, however, I have no way of communicating with the application from the gui. I do write text files that the application checks for periodically, but this is not what I want to do. I would like to use the signal/slot mechanism (or possibly something else?) to communicate information to the gui and vice versa. Is this possible with completely separate executables?
Also, maybe it would be better to simply put the other application in with the gui? Is there a way to execute event loops and not lose the funcionality of the gui? The event loop would need to run for an extended period (minutes) but I also need access to the gui in the mean time. Is this possible?
Hi Kenneth Carrell,
try to specify platform,compiler,ROOT version.
Thanks. Regards. Valeriy
Here is the machine information:
Linux pcttudaq 2.4.20-30.7.cernsmp #1 SMP Thu Feb 19 12:36:51 CET 2004 i686 unknown
and the compiler:
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)
and the ROOT version:
Hi Kenneth, that’s better
Back to your question … sorry, I didn’t read it carefully
For a moment signal/slots can not be used to communicate
between processes. However, the idea is very good in general.
It would be good to have smthng like
obj->Connect(signal, class, machine//process/object, slot)
I start thinking about it.
For a moment you can use TSocket class for interprocess
communication. Check $ROOTSYS/tutorials/hserv.C, hclient.C macros.
Is there some way that I can add this program in with my ROOT gui and have the information available that way? For example, is there some way to execute a macro in the background (either through TApplication or some other method) that will allow me to still have access to the gui and its functionality? I don’t need to have a lot of communication between the two, just an update on how many events it has taken every once in a while and when it is finished. Can you tell me a way to accomplish this?
looks like you need “multithreading”.
The easiest way is:
///////// workerThread.C //////////////////////////////
roott = new TTimer(1000);