Public Member Functions

CallbackMessage Class Reference

A message that calls a custom function when it gets delivered. More...

Inherits Message.

List of all members.

Public Member Functions

 CallbackMessage () noexcept
 ~CallbackMessage ()
 Destructor.
virtual void messageCallback ()=0
 Called when the message is delivered.
void post ()
 Instead of sending this message to a MessageListener, just call this method to post it to the event queue.

Detailed Description

A message that calls a custom function when it gets delivered.

You can use this class to fire off actions that you want to be performed later on the message thread.

Unlike other Message objects, these don't get sent to a MessageListener, you just call the post() method to send them, and when they arrive, your messageCallback() method will automatically be invoked.

Always create an instance of a CallbackMessage on the heap, as it will be deleted automatically after the message has been delivered.

See also:
MessageListener, MessageManager, ActionListener, ChangeListener

Constructor & Destructor Documentation

CallbackMessage::CallbackMessage (  )
CallbackMessage::~CallbackMessage (  )

Destructor.


Member Function Documentation

virtual void CallbackMessage::messageCallback (  ) [pure virtual]

Called when the message is delivered.

You should implement this method and make it do whatever action you want to perform.

Note that like all other messages, this object will be deleted immediately after this method has been invoked.

void CallbackMessage::post (  )

Instead of sending this message to a MessageListener, just call this method to post it to the event queue.

After you've called this, this object will belong to the MessageManager, which will delete it later. So make sure you don't delete the object yourself, call post() more than once, or call post() on a stack-based obect!


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines