Hi,
I've just made a new external [getpatchname], which will return the filename of the patch in which it is instantiated. It has been committed to the CVS under externals/postlude, and has been tested under Linux.
This functionality may well be available somewhere else, in which case I would be intruiged to know how/where - particularly if it can be done without externals.
Also, the external is currently buggy in the sense that it retains the patch name from the external's instantiation, so if you rename the patch then send a 'bang' message to the object, it will report the 'old' patch name. This is because accessing canvas_getcurrent()->gl_name from a method call rather than from getpatchname_new results in a segfault. I would be interested to know why this is....
best,
Jamie
HI all,
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.)
cheers Miller
On Wed, Jul 12, 2006 at 05:00:46PM +0100, Jamie Bullock wrote:
Hi,
I've just made a new external [getpatchname], which will return the filename of the patch in which it is instantiated. It has been committed to the CVS under externals/postlude, and has been tested under Linux.
This functionality may well be available somewhere else, in which case I would be intruiged to know how/where - particularly if it can be done without externals.
Also, the external is currently buggy in the sense that it retains the patch name from the external's instantiation, so if you rename the patch then send a 'bang' message to the object, it will report the 'old' patch name. This is because accessing canvas_getcurrent()->gl_name from a method call rather than from getpatchname_new results in a segfault. I would be interested to know why this is....
best,
Jamie
PD-announce mailing list PD-announce@iem.at http://lists.puredata.info/listinfo/pd-announce
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Wed, 12 Jul 2006, Miller Puckette wrote:
On Wed, Jul 12, 2006 at 05:00:46PM +0100, Jamie Bullock wrote:
Also, the external is currently buggy in the sense that it retains the patch name from the external's instantiation, so if you rename the patch then send a 'bang' message to the object, it will report the 'old' patch name. This is because accessing canvas_getcurrent()->gl_name from a method call rather than from getpatchname_new results in a segfault. I would be interested to know why this is....
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 ?
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
The usual reason: my reluctance to add bloat to data structures...
cheers Miller
On Wed, Jul 12, 2006 at 08:55:56PM -0400, Mathieu Bouchard wrote:
On Wed, 12 Jul 2006, Miller Puckette wrote:
On Wed, Jul 12, 2006 at 05:00:46PM +0100, Jamie Bullock wrote:
Also, the external is currently buggy in the sense that it retains the patch name from the external's instantiation, so if you rename the patch then send a 'bang' message to the object, it will report the 'old' patch name. This is because accessing canvas_getcurrent()->gl_name from a method call rather than from getpatchname_new results in a segfault. I would be interested to know why this is....
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 ?
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - t?l:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montr?al QC Canada