Appendix: Messages sent to Objects

When writing objects for Max, you typically think of creating methods which are called when a message is sent to your object through the object's inlet.

However, your object may receive messages directly from Max rather than using the inlet.

One common example is the "assist" message, which is sent to your object when a user's mouse cursor hovers over one of your object's inlets or outlets. If your object binds a method to the "assist" message then you will be able to customize the message that is shown.

This appendix serves as a quick reference for messages that are commonly sent to objects by Max, should they be implemented by the given object. Where possible, the prototypes given are actual prototypes from example objects in the SDK rather than abstractions to assist in finding the context for these calls.

Messages for All Objects

acceptsdrag_locked long pictmeter_acceptsdrag_unlocked(t_pictmeter *x, t_object *drag, t_object *view);
acceptsdrag_unlocked long pictmeter_acceptsdrag_unlocked(t_pictmeter *x, t_object *drag, t_object *view);
assist void pictmeter_assist(t_pictmeter *x, void *b, long m, long a, char *s);
dumpout bind this message to object_obex_dumpout() rather than defining your own method.
inletinfo void my_obj(t_object *x, void *b, long a, char *t) you may bind to stdinletinfo() or define your own inletinfo method.

The 'b' parameter can be ignored, the 'a' parameter is the inlet number, and 1 or 0 should set the value of '*t' upon return.
notify t_max_err dbviewer_notify(t_dbviewer *x, t_symbol *s, t_symbol *msg, void *sender, void *data);
quickref obsolete, this is provided automatically now

Messages for Non-UI Objects

dblclick void scripto_dblclick(t_scripto *x);

Messages for User Interface Objects

getdrawparams void uisimp_getdrawparams(t_uisimp *x, t_object *patcherview, t_jboxdrawparams *params);
mousedown void scripto_ui_mousedown(t_scripto_ui *x, t_object *patcherview, t_pt pt, long modifiers);
mouseup void uisimp_mouseup(t_uisimp *x, t_object *patcherview, t_pt pt, long modifiers);
mousedrag void scripto_ui_mousedrag(t_scripto_ui *x, t_object *patcherview, t_pt pt, long modifiers);
mouseenter void uisimp_mouseenter(t_uisimp *x, t_object *patcherview, t_pt pt, long modifiers);
mouseleave void uisimp_mouseleave(t_uisimp *x, t_object *patcherview, t_pt pt, long modifiers);
mousemove void uisimp_mousemove(t_uisimp *x, t_object *patcherview, t_pt pt, long modifiers);
paint void pictmeter_paint(t_pictmeter *x, t_object *patcherview);

Message for Audio Objects

dsp void plus_dsp(t_plus *x, t_signal **sp, short *count);
dspstate plus_dspstate(t_plus *x, long n);

Messages for Objects Containing Text Fields

key long uitextfield_key(t_uitextfield *x, t_object *patcherview, long keycode, long modifiers, long textcharacter);
keyfilter long uitextfield_keyfilter(t_uitextfield *x, t_object *patcherview, long *keycode, long *modifiers, long *textcharacter);
enter void uitextfield_enter(t_uitextfield *x);
select void uitextfield_select(t_uitextfield *x);

Messages for Objects with Text Editor Windows

edclose void simpletext_edclose(t_simpletext *x, char **text, long size);

Messages for Dataview Client Objects

getcelltext void dbviewer_getcelltext(t_dbviewer *x, t_symbol *colname, long index, char *text, long maxlen);
newpatcherview void dbviewer_newpatcherview(t_dbviewer *x, t_object *patcherview);
freepatcherview void dbviewer_freepatcherview(t_dbviewer *x, t_object *patcherview);