Wide Studio Object Reference

Wide Studio Home
Up to


Class Name

WSDmessage

Specification of methods



getNewInstance Function Description

Form
WSDmessage* getNewInstance()
Function
Create new message class instance
Description
Message instance can set one message identification string and message receiving function. Messages are posted by specifying a message ID by the sendMessageEx
Parameters
None.
Return value
A pointer to a message instance
Notice
Samples
//Receive a message
void message_proc(char* data,void* ptr){
  printf("receive data=%s\n",data);
}
//Setup for receiving messages
WSDmessage* message = NULL;
void init_proc(){
  message = WSDmessage::getNewInstance();
  message->setupMessage("message1",message_proc,NULL);
}

//Send a message
void send_proc(char* send_data){
  WSDmessage::sendMessageEx(NULL,"message1",send_data);
}



setupMessage Function Description

Form
void setupMessage(char* index,void(*proc)(char*,void*),void*)
Function
Set a message ID and a message hander
Description
When a message is sent with a specified message ID, this message instance receives the message and execute the message hander.
Parameters
(in)char* index Message identification string
(in)void (*proc)(char*,void*) Message handler function

Return value
None.
Notice
Only one message ID string can be set per one message instance. When setupMessage( ) is invoked more than twice, last setupMessage( ) setting is effective.
Samples
Refer to getNewInstance()



sendMessageEx Function Description

Form
int sendMessageEx(char* disp,char* index,char* data)
Function
Send a message with a specified message identification string
Description
When it is X11 Window System, disp parameter is the name of the display name When there is no need to set, it can be NULL. Also when it is Windows, the parameter is ignored. Send strings starting with data using a message ID string.
Parameters
(in)char* disp Display name
(in)char* message Message ID string
(in)char* data String sata to be sent

Return value
Notice
Samples
Refer to getNewInstance()


Document Release 3.0

For Use with Wide Studio Release 3.0, Summer 2002


Wide Stuido Home | Up to

Copyright(C) T. Hirabayashi, 1999-2002 Last modified: July 15, 2002