On Thu, 13 Jul 2006, Jamie Bullock wrote:
On Wed, 12 Jul 2006 20:55:56 -0400 (EDT) Mathieu Bouchard matju@artengine.ca wrote:
On Wed, 12 Jul 2006, Miller Puckette wrote:
canvas_getcurrrent() is only valid in the context of teh new() routine... you can call it there and save the result in the instance structure if you need to refer back to it (as in this case.)
Yes. It seems like every GUI object has such a backpointer in its struct, including msg (Ctrl+2), floatatom (Ctrl+3) and symbolatom (Ctrl+4). Why not make it standard and add it to t_text ?
Could you explain what you mean by 'backpointer', Google and Wikipedia aren't throwing up much. I'm just trying to understand why this doesn't work.
a backpointer is simply a pointer to the parent node, supposing that there are parent/child relationships. In Pd, this always means a t_canvas*.
what Miller said is that canvas_getcurrent() is only valid while inside the constructor. So you have to make a backup of the value of canvas_getcurrent() from inside the constructor, into the struct t_getpatchname.
BTW, should it be called [getpatchname] or [getcanvasname] ?
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada