[Gridflow-cvs] [svn] commit: r3254 - in /trunk/base: flow_objects.c flow_objects.rb

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Thu Mar 20 00:31:11 EDT 2008


Author: matju
Date: Thu Mar 20 00:31:10 2008
New Revision: 3254

Log:
the new [display] works!

Modified:
    trunk/base/flow_objects.c
    trunk/base/flow_objects.rb

Modified: trunk/base/flow_objects.c
==============================================================================
--- trunk/base/flow_objects.c (original)
+++ trunk/base/flow_objects.c Thu Mar 20 00:31:10 2008
@@ -249,7 +249,7 @@
 			for (int i=0; i<n; i++) SETFLOAT(a+i,s[i]);
 			//fprintf(stderr,"dest=%p\n",dest);
 			//fprintf(stderr,"*dest={%08x,%08x,%08x,%08x,...}\n",dest[0],dest[1],dest[2],dest[3]);
-			pd_list(dest,&s_list,n,a);
+			pd_typedmess(dest,gensym("very_long_name_that_nobody_uses"),n,a);
 		}
 	}
 	void puts (std::string s) {puts(s.data());}

Modified: trunk/base/flow_objects.rb
==============================================================================
--- trunk/base/flow_objects.rb (original)
+++ trunk/base/flow_objects.rb Thu Mar 20 00:31:10 2008
@@ -533,8 +533,9 @@
 end
 
 if FObject.respond_to?(:gui_enable)
-class Display < FObject; include Gooey
+class Display < GridObject; include Gooey
 	attr_accessor :text
+	install_rgrid 0
 	def initialize()
 		super
 		@sel = nil; @args = [] # contents of last received message
@@ -546,11 +547,12 @@
 		@gp = Pd.objectmaker(:"#print")
 		#@gp.send_in 0, :trunc, 70
 		Pd.send_in @gp, 0, :maxrows, 20
+		@clock = Clock.new self
 	end
 	def initialize2()
 		super
 		b=bself
-		STDERR.puts "initialize2: bself=#{b.inspect}"
+		#STDERR.puts "initialize2: bself=#{b.inspect}"
 		Pd.send_in @gp, 0, :dest, b
 	end
 	def _0_set_size(sy,sx) @sy, at sx=sy,sx end
@@ -570,7 +572,7 @@
 			when :float; atom_to_s @args[0]
 			else @sel.to_s + ": " + @args.map{|a| atom_to_s a }.join(' ')
 			end
-		update
+		@clock.delay 0
 	end
 	def pd_show(can)
 		super
@@ -583,8 +585,13 @@
 		GridFlow.gui %{ #{canvas} delete #{@rsym} #{@rsym}TEXT \n} if @vis
 		super
 	end
-	def _0_grid(*foo) Pd.send_in @gp, 0, :grid, *foo end
-	install "display", 2, 1
+	def _0_grid(*foo) @text=""; Pd.send_in @gp, 0, :grid, *foo; @clock.delay 0 end
+	def call; update; end
+	def _0_very_long_name_that_nobody_uses(*list)
+		@text << "\n" if @text.length>0
+		list.each {|x| @text<<x.to_i }
+	end
+	install "display", 1, 1
 	gui_enable
 
 	GridFlow.gui %{



More information about the Gridflow-cvs mailing list