ToolTalk ユーザーズガイド

例 8–5 は、pnotice の作成方法と送信方法を示しています。


例 8–5 pnotice の作成と送信

	/*
	* Create and send a ToolTalk notice message
	* ttsample1_value(in int <new value)
	*/

	msg_out = tt_pnotice_create(TT_SESSION, “ttsample1_value”);
	tt_message_arg_add(msg_out, TT_IN, “integer”, NULL);
	tt_message_arg_ival_set(msg_out, 0, (int)xv_get(slider, 
	    PANEL_VALUE));
	tt_message_send(msg_out);

	/*
	* Since this message is a notice, we don't expect a reply, so
	* there's no reason to keep a handle for the message.
	*/

	tt_message_destroy(msg_out);


例 8–6 は、cntl_ui_hilite_button のコールバックルーチンを呼び出す場合の orequest の作成と送信方法を示しています。


例 8–6 orequest の作成と送信

/*
 * Notify callback function for `cntl_ui_hilite_button'.
 */
void
cntl_ui_hilite_button_handler(item, event)
	Panel_item		item;
	Event		*event;
{
	Tt_message		msg;
	
	if (cntl_objid == (char *)0) {
		xv_set(cntl_ui_base_window, FRAME_LEFT_FOOTER,
		 “No object id selected”, NULL);
		return;
	}
	msg = tt_orequest_create(cntl_objid, “hilite_obj”);
	tt_message_arg_add(msg, TT_IN, “string”, cntl_objid);
	tt_message_callback_add(msg, cntl_msg_callback);
	tt_message_send(msg);
}