![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
#include <FXMessageChannel.h>
Public Types | |
enum | { ID_IO_READ = 1, ID_LAST } |
Public Member Functions | |
FXMessageChannel (FXApp *a) | |
FXApp * | getApp () const |
FXbool | message (FXObject *tgt, FXSelector msg, const void *data=NULL, FXint size=0) |
virtual | ~FXMessageChannel () |
When an FXMessageChannel is constructed, it automatically calls addInput() function to register itself as the message handler for the SEL_IO_READ message from FXApp. Likewise, when FXMessageChannel is destroyed, it calls removeInput() to remove itself as the message handler for the SEL_IO_READ message from FXApp. When a worker thread calls the message() API, the target and message, as well as optional message data, are written into the message channel. The main user-interface thread is awakened and subsequently dispatches to the onMessage handler of FXMessageChannel, which reads the target, selector, and optional message data from the channel and then dispatches to this target using the given selector. Thus, FXMessageChannel provides a worker thread with a way to asynchronously invoke any message handler in the context of the main user-interface thread. If the size of the optional data is zero, the message handler will be passed a NULL pointer.
FX::FXMessageChannel::FXMessageChannel | ( | FXApp * | a | ) |
Initialize message channel.
virtual FX::FXMessageChannel::~FXMessageChannel | ( | ) | [virtual] |
Clean up message channel.
FXApp* FX::FXMessageChannel::getApp | ( | ) | const [inline] |
Get application pointer.
FXbool FX::FXMessageChannel::message | ( | FXObject * | tgt, | |
FXSelector | msg, | |||
const void * | data = NULL , |
|||
FXint | size = 0 | |||
) |
Send a message msg comprising of FXSEL(type,id) to a target tgt, and pass optional data of size bytes.
![]() |