EditEventSend
From TrillWiki
The editEventSend function sends an event to an edit area of a chat window.
Compatibility: 2.0 and higher
Contents |
Syntax
plugin_send(MYGUID, "editEventSend", edit_event_t *)
Note that all Trillian functions and notifications begin with a lower-case letter, despite the Wiki requirement that all pages start with a capital letter.
Parameters
EditEventSend utilitizes the edit_event_t structure.
struct edit_event_t {
unsigned int struct_size;
int window_id;
int edit_event_id;
char *event;
ttkCallback callback;
void *data;
};
- window_id
- The window ID to send the event to.
- event
- The event to send. For a list of events, see the remarks section.
- data
- The data field of the particular event. Not all events may require this field.
Return Value
Returns a negative value on error, 0 on success.
Remarks
There are a few events that can be sent to an edit area. Here is the full list currently available:
- edit_setText
- Change the text of an area to a specified string. This text should be in UTF-8 and HTML. Convert all <'s to <'s, etc. Also, you may use some custom HTML to specify other functionality. This includes <cursor/> (for the current cursor location) and <su color="#ff0000">text</su> (to draw a special underline under some text; the color may be omitted). The data field is a char* of the text. The return value is always 0.
- edit_addMenu
- To add your own custom menu to the right click option choices for the edit area. The data field is an edit_menu_t*. Be sure to remove the menu when you are finished with it. The return value is the menu_id.
- edit_removeMenu
- This removes a particular menu that was added using the edit_addMenu command. The data is a edit_menu_t with the id filled in with the value returned from edit_addMenu.
