DesktopX 2.4 Developer’s Guide
_____________________________________________________________________________
_____________________________________________________________________________
Page 29
3.5 Sending Messages
Sending messages in DesktopX is actually a really simple concept to understand and simple to
achieve.
In summary, sending messages means that when a user interacts with one object, cause one or
more different objects to react. Consider a light in your room. When you flick the switch it
changes state, but also the light bulb itself changes state. When you flick the switch, a message is
sent to the light bulb which also changes state.
Sending messages is very simple. Simply, go to the 'States' tab of the object you want to send
then message from, select the state which you want to occur in order for the message to be sent
(e.g. Command executed) and then click the 'Messages' tab.
Once you have done this click the 'Add' button to pop up the messages dialogue.
There are two things to define in this dialogue; the Destination and the Message to send.
The 'Destination' is the object to which you want to send the message. For example in the
example above the object to which we would be sending the message is the Light Bulb.
You have two options here. The first is to send the message to every other object in the theme.
You should use this option very carefully as obviously in a large theme this could cause several
objects to change state at once and you may end up with a massive cascade of state changes, or
even a loop you can't get out of if objects send messages to each other.
The more likely option is that you will be sending a message to a specific object, in which case
you should select that option and choose the object from the list.
The second thing to define is the message itself. The drop down list will show a list of the default
messages from which you can select. Alternatively, if you know of a custom message that has
been set up for the destination object you can send that message by typing in the name of that
message.
You can add as many messages as you want and an object can send different messages in
different states - e.g. it may send one message when the mouse is over an object, and a different
one when the mouse moves away from the object.
That's it - sending messages is that simple and the results can be really impressive.