Cycling74/max-sdk

simplemax.c doesn't use an external editor

benbrackenc74 opened this issue · 0 comments

simplemax.c example could be updated to show sending the 'openwindow' message to the jed, which should make it compatible with using an external editor. Something like:

void simpletext_dblclick(t_simpletext *x)
{
	if (x->t_editor)
		object_attr_setchar(x->t_editor, gensym("visible"), 1);
	else {
		x->t_editor = object_new(CLASS_NOBOX, gensym("jed"), x, 0);
		object_method(x->t_editor, gensym("settext"), *x->t_text, gensym("utf-8"));
		object_attr_setchar(x->t_editor, gensym("scratch"), 1);
		object_attr_setsym(x->t_editor, gensym("title"), gensym("simpletext"));
	}
	object_method(x->t_editor, gensym("openwindow"));
}