共通デスクトップ環境 ToolTalk メッセージの概要

Ttmedia_load_msg_cb の例

例 D-3 は、このコールバックの典型的なアルゴリズムの例です。


例 D-3 Ttmedia_load_msg_cb の典型的なアルゴリズム

Tt_message 
myLoadMsgCB(
    Tt_message      msg,
    void            *clientData,
    Tttk_op         op,
    unsigned char   *contents,
    int             len,
    char            *file
)
{
    if (len > 0) {
      // Replace data with len bytes in contents
    } else if (file != 0) {
      // Replace data with data read from file
    }
    if (op == TTME_DEPOSIT) {
      tt_message_reply( msg );
    }
    tttk_message_destroy( msg );
    return 0; 
}