Event Handling In Root

Can anyone point me to some documentation or sample code that explains the difference between the relationship and/or differences between the signal/slot architecture in root and the previous message passion funtionality using SendMessage, etc.

I am trying to get a deeper understanding of event handling in root and the relationship with x-windows so I can efficiently write my code. I have been studying the class structure and souce code of the root framework. However, it would be helpful to see some discussion on this.

Thanks in advance for your help.

Jon

Hi Jon,

the signal/slot method is the most flexible solution allowing decoupling between the object emitting and receiving the signals, also more than one object can receive the signals, etc. The (small) drawback is that it requires the emitting and receiving classes to have dictionaries.

The message passing solution was written before the more flexible signal/slots were introduced.

For checking code employing the two different solutions see:
tutorials/guitest.C – signal/slots
test/guitest.cxx – message passing

Cheers, Fons.

Fons,

Thanks for your kind reply. The questions I am having are not so much with respect to the new signals and slots mechanism, but with understanding the old messaging system. There doesn’t seem to be too much documentation on this and I am trying to understand what parts of the code I can remove. For example the member function ProcessMessage seems to be part of the old communication mechanism. Is this correct?

Also, would it be helpful to install QT for root? What functionality does this provide that is not available in the latest Root since I understand that your system is now based on Qt.

Finally on dictionaries, can you explain how the dictionary is used to enable the signals/slots mechanism. Do I have to give my dictionary a particular name so that it is recognized at runtime?

Thanks in advance.

Jon

Hi Jon,

[quote=“jon149”]Fons,

Thanks for your kind reply. The questions I am having are not so much with respect to the new signals and slots mechanism, but with understanding the old messaging system. There doesn’t seem to be too much documentation on this and I am trying to understand what parts of the code I can remove. For example the member function ProcessMessage seems to be part of the old communication mechanism. Is this correct?

Also, would it be helpful to install QT for root?
[/quote]
not. It is not necessary.

not. It is not based on Qt.

dictionary allows full RTTI. That is used in ROOT signals/slots mechanism.

not clear question for me …

Regards. Valeriy