[Gridflow-cvs] [svn] commit: r5204 - /trunk/src/classes2.cxx

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


Author: matju
Date: Sat Mar 27 23:12:21 2010
New Revision: 5204

Log:
add [gf/canvas_index]

Modified:
    trunk/src/classes2.cxx

Modified: trunk/src/classes2.cxx
==============================================================================
--- trunk/src/classes2.cxx (original)
+++ trunk/src/classes2.cxx Sat Mar 27 23:12:21 2010
@@ -1188,6 +1188,19 @@
 	\decl 0 bang () {MOM; int k=0; canvas_each(y,m) k++; outlet_float(outlets[0],k);}
 };
 \end class {install("gf/canvas_count",1,1);}
+\class GFCanvasIndex : FObject {
+	int n;
+	\constructor (int n) {this->n=n;}
+	\decl 0 bang () {
+		MOM;
+		t_canvas *mm=m->gl_owner;
+		if (!mm) RAISE("chosen canvas is not in any canvas");
+		int k=0;
+		canvas_each(y,mm) {if (y==(t_gobj *)m) break; else k++;}
+		outlet_float(outlets[0],k);
+	}
+};
+\end class {install("gf/canvas_index",1,1);}
 
 \class GFCanvasLoadbang : FObject {
 	int n;



More information about the Gridflow-cvs mailing list