[PD-dev] graphical arrays & subpatches

Brian Sheehan rbsheehan at yahoo.com
Fri Aug 8 12:37:22 CEST 2003


Hi,

I have an object that writes to a graphical array. The
array to write to is specified by one of the objects
creation arguments. I would like the array to be drawn
in a subwindow. But unless the subwindow is actually
open at object creation time, the object won't find
the array. Is there a way around this?

Here's the code I use to find the array (courtesy of
tabwrite~):
 
t_garray *a;

x->display_vec_name = s;//s is a symbol
if (!(a = (t_garray
*)pd_findbyclass(x->display_vec_name, garray_class)))
{
   if (*s->s_name) pd_error(x, "squiggle~: %s: no such
array",
   x->display_vec_name->s_name);
   x->display_vec = 0;
}
else if (!garray_getfloatarray(a, &x->display_size,
&x->display_vec))
{
   error("%s: bad template for squiggle~",
x->display_vec_name->s_name);
   x->display_vec = 0;
}

thanks,

Brian

p.s. Is there any way of creating a graphical array
from within an external object? It'd be cool if my
object could create an array of the correct size for
its purposes, rather than me having to do it every
time I use the object.

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com




More information about the Pd-dev mailing list