[Gridflow-cvs] [svn] commit: r6392 - in /trunk: doc/flow_classes/setargs-help.pd src/classes2.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Mon Oct 4 12:14:46 EDT 2010


Author: matju
Date: Mon Oct  4 12:14:42 2010
New Revision: 6392

Log:
[setargs]: add method 'dirty'

Modified:
    trunk/doc/flow_classes/setargs-help.pd
    trunk/src/classes2.cxx

Modified: trunk/doc/flow_classes/setargs-help.pd
==============================================================================
--- trunk/doc/flow_classes/setargs-help.pd (original)
+++ trunk/doc/flow_classes/setargs-help.pd Mon Oct  4 12:14:42 2010
@@ -1,21 +1,21 @@
-#N canvas 596 24 632 642 10;
+#N canvas 533 38 632 642 10;
 #X obj 0 0 doc_h;
-#X obj 3 852 doc_also;
-#X obj 0 872 doc_f;
-#X obj 103 852 args;
+#X obj 3 944 doc_also;
+#X obj 0 964 doc_f;
+#X obj 103 944 args;
 #X obj 3 281 doc_c 0;
 #X obj 3 321 doc_i 1;
 #X obj 14 351 doc_ii 0;
-#X obj 97 719 doc_m i0 set;
+#X obj 97 811 doc_m i0 set;
 #X obj 97 373 doc_m i0 add2;
 #X obj 97 395 doc_m i0 addcomma;
 #X obj 97 597 doc_m i0 addsemi;
-#X obj 3 812 doc_o 0;
+#X obj 3 904 doc_o 0;
 #X text 232 597 just like messageboxes;
 #X text 232 395 just like messageboxes;
 #X text 232 373 just like messageboxes;
 #X obj 30 52 setargs;
-#X text 90 234 for a demonstration \, please open this abstraction
+#X text 91 234 for a demonstration \, please open this abstraction
 instance;
 #X obj 97 417 doc_m i0 adddollar;
 #X obj 97 439 doc_m i0 adddollsym;
@@ -24,11 +24,11 @@
 the canvas-environment \, and the titlebar of the patch window \, whenever
 one of its five methods are called.;
 #X obj 97 351 doc_m i0 add;
-#X obj 139 852 gf/propertybang;
+#X obj 139 944 gf/propertybang;
 #X text 232 417 just like messageboxes;
 #X text 232 351 just like messageboxes;
-#X text 232 719 just like messageboxes;
-#X text 232 741 don't forget to write the classname! If you use it
+#X text 232 811 just like messageboxes;
+#X text 232 833 don't forget to write the classname! If you use it
 without arguments \, make sure that the classname is the next thing
 that you add. But the classname will only be applied at the next reload
 \, delete/undo \, copy/paste \, or duplicate.;
@@ -48,8 +48,7 @@
 \$2 character by a dollar sign. no leading dollarsign is implied.;
 #X text 232 553 thus adddollsym2 foo-%1-bar % gives foo-\$1-bar;
 #X text 232 575 and adddollsym2 @0-zut- at 3 @ gives \$0-zut-\$3;
-#X obj 93 217 setargs-demo 574 457 223 573 591 363 276 967 206 315
-;
+#X obj 93 217 setargs-demo 340 209 372 114 448 305 91 4 906 98;
 #X obj 93 179 # rand;
 #X obj 93 124 tgl 15 0 empty empty empty 17 7 0 10 -204786 -1 -1 0
 1;
@@ -57,6 +56,12 @@
 #X obj 93 198 #to_list;
 #X obj 93 105 loadbang;
 #X obj 93 141 metro 500;
+#X obj 97 719 doc_m i0 dirty;
+#X text 232 789 default is 1;
+#X text 232 719 \$1=1 means the canvas containing the abstraction that
+we are in should be set as having unsaved changes.;
+#X text 232 754 \$1=0 means it should be set as not having unsaved
+changes (in practice you shouldn't use this);
 #X connect 1 1 3 0;
 #X connect 1 1 21 0;
 #X connect 7 1 24 0;
@@ -79,3 +84,6 @@
 #X connect 40 0 36 0;
 #X connect 41 0 38 0;
 #X connect 42 0 39 0;
+#X connect 43 1 45 0;
+#X connect 43 1 46 0;
+#X connect 43 1 44 0;

Modified: trunk/src/classes2.cxx
==============================================================================
--- trunk/src/classes2.cxx (original)
+++ trunk/src/classes2.cxx Mon Oct  4 12:14:42 2010
@@ -157,7 +157,7 @@
 		binbuf_addv(d,"s",gensym("args"));
 		binbuf_add(d,max(int(binbuf_getnatom(b))-1,0),binbuf_getvec(b)+1);
 		t_canvasenvironment *pce = canvas_getenv(canvas->gl_owner);
-		if (!pce) RAISE("no canvas environment for canvas containing canvas containing [setargs]");
+		if (!pce) RAISE("no canvas environment for canvas containing abstraction that [setargs] is in");
 		pd_pushsym((t_pd *)canvas);
 		binbuf_addbinbuf(e,d);
 		binbuf_eval(e,(t_pd *)bself,pce->ce_argc,pce->ce_argv);
@@ -197,6 +197,13 @@
 		SETDOLLSYM(&a,gensym(d));
 		free(d);
 		binbuf_add(b,1,&a); mom_changed();
+	}
+	\decl 0 dirty (bool state=1) {
+		t_atom2 a[]={state};
+		t_glist *m = canvas->gl_owner;
+		if (!m) RAISE("missing canvas");
+		typedmess((t_pd *)m,gensym("dirty"),1,a);
+		//if (glist_isvisible(canvas)) canvas_reflecttitle(canvas);
 	}
 };
 \end class {install("setargs",1,0);}



More information about the Gridflow-cvs mailing list