[Gridflow-cvs] [svn] commit: r5208 - /trunk/src/gridflow.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Sat Mar 27 23:41:47 EDT 2010


Author: matju
Date: Sat Mar 27 23:41:47 2010
New Revision: 5208

Log:
canvas: add method last_activate

Modified:
    trunk/src/gridflow.cxx

Modified: trunk/src/gridflow.cxx
==============================================================================
--- trunk/src/gridflow.cxx (original)
+++ trunk/src/gridflow.cxx Sat Mar 27 23:41:47 2010
@@ -921,7 +921,7 @@
 #endif
 
 static void canvas_else (t_canvas *self, t_symbol *s, int argc, t_atom *argv) {
-	t_gobj *g = canvas_last(self); if (!g) {pd_error(self,"else: no last"); return;}
+	t_gobj *g = canvas_last(self); if (!g) {pd_error(self,"canvas else: there is no last object"); return;}
 	if (pd_newest()) return;
 	glist_delete(self,g);
 	if (argc<1 || argv[0].a_type!=A_SYMBOL) {error("$1 must be a symbol"); return;}
@@ -938,11 +938,15 @@
 	return n ? (t_pd *)self : (t_pd *)self->ob_inlet;
 }
 static void canvas_tolast (t_canvas *self, t_symbol *s, int argc, t_atom *argv) {
-	t_gobj *g = canvas_last(self); if (!g) {pd_error(self,"else: no last"); return;}
+	t_gobj *g = canvas_last(self); if (!g) {pd_error(self,"canvas last: there is no last object"); return;}
 	if (argc<1 || argv[0].a_type!=A_SYMBOL) {error("$1 must be a symbol"); return;}
 	//post("tolast: class=%s",pd_class(g)->c_name->s_name);
 	t_pd *r = text_firstinlet((t_text *)g);
 	pd_typedmess(r,argv[0].a_symbol,argc-1,argv+1);
+}
+static void canvas_last_activate (t_canvas *self, t_symbol *s, int argc, t_atom *argv) {
+	t_gobj *g = canvas_last(self); if (!g) {pd_error(self,"canvas last: there is no last object"); return;}
+        gobj_activate(g,self,1);
 }
 
 // those are not really leaks but deleting them make them disappear from valgrind
@@ -1045,6 +1049,7 @@
 	#endif
     atexit(gridflow_unsetup);
     extern t_class *canvas_class;
-    class_addmethod(canvas_class,(t_method)canvas_else,  gensym("else"),A_GIMME,0);
-    class_addmethod(canvas_class,(t_method)canvas_tolast,gensym("last"),A_GIMME,0);
-}
+    class_addmethod(canvas_class,(t_method)canvas_else,         gensym("else")         ,A_GIMME,0);
+    class_addmethod(canvas_class,(t_method)canvas_tolast,       gensym("last")         ,A_GIMME,0);
+    class_addmethod(canvas_class,(t_method)canvas_last_activate,gensym("last_activate"),A_GIMME,0);
+}



More information about the Gridflow-cvs mailing list