Hey,
I want to make a general purpose way of getting the window and canvas pointers within Pd. I was thinking that making [canvas_name] accept the filename as a symbol, and then it would output the .x%lx.c.
So my question is, how do I get the canvas pointer from the filename?
.hc
------------------------------------------------------------------------ ----
If you are not part of the solution, you are part of the problem.
Hans-Christoph Steiner wrote:
Hey,
I want to make a general purpose way of getting the window and canvas pointers within Pd. I was thinking that making [canvas_name] accept the filename as a symbol, and then it would output the .x%lx.c.
So my question is, how do I get the canvas pointer from the filename?
you don't. the canvas is per instance (more or less), whereas the filename is per class.
you cannot generate info from the general class for instance-specific data. e.g. i cannot derive "hans-christoph" if i only know "steiner" (at least in austria, "steiner" is a common name).
fgma.r IOhannes
On Fri, 9 Nov 2007, Hans-Christoph Steiner wrote:
I want to make a general purpose way of getting the window and canvas pointers within Pd. I was thinking that making [canvas_name] accept the filename as a symbol, and then it would output the .x%lx.c. So my question is, how do I get the canvas pointer from the filename?
You have to walk the list of canvases and get one of the canvases that have that filename. You run into the same problem as there is with trying to avoid [namecanvas]: there can be several canvases with the same filename. This is also related to why $0 exists.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada