Before your application can receive messages from other applications,
you must set up your process to watch for arriving messages. When
a message arrives for your application, the file descriptor becomes
active. The code you use to alert your application that the file
descriptor is active depends on how your application is structured.
For example, a program can have a callback function invoked
when the file descriptor becomes active. The following code sample
invokes notify_set_input_func with the handle for the message object
as a parameter.
/* * Arrange for a program to call receive_tt_message when the * ToolTalk file descriptor becomes active. */ notify_set_input_func(base_frame, (Notify_func)receive_tt_message, ttfd);
|
Table 6-2 describes various window toolkits and the
call used to watch for arriving messages.
Table 6-2 Code Used
to Watch for Arriving Messages
| Window Toolkits | Code Used |
|---|
| XView | notify_set_input_func() |
| X Window System Xt (Intrinsics) | XtAddInput() or XtAddAppInput() |
| Other toolkits including Xlib structured around
select(2) or poll(2) system calls | The file descriptor returned by tt_fd(). |
| | Note: Once the file descriptor is active and
the select call exits, use tt_message_receive() to obtain a handle
for the incoming message. |