Does anyone know of a way to dynamically destroy an object using the "send pd-xxx" approach? Also, is there anyway to disconnect objects dynamically?
hi
|Does anyone know of a way to dynamically destroy an object using the |"send pd-xxx" approach? Also, is there anyway to disconnect objects |dynamically?
did you find/make anything? i ve only managed to selectall,menu_cut and start over from scratch. ;)
the problem with both destroying and disconnecting is getting the reference to the object. you could either emulate a mouseclick, or work out how to access the stuff via canvas/glist directly,
-- > < D ¥ . 0 R g
hi
hi
|Does anyone know of a way to dynamically destroy an object using the |"send pd-xxx" approach? Also, is there anyway to disconnect objects |dynamically?
did you find/make anything? i ve only managed to selectall,menu_cut and start over from scratch. ;)
the problem with both destroying and disconnecting is getting the reference to the object. you could either emulate a mouseclick, or work out how to access the stuff via canvas/glist directly,
i once tried and added a method to canvases that destroyed them. it did work, but only a few times (some 1000). after creating/destroying 1000s of obects pd was sure to crash. i only changed the pd code slightly (some lines) and therefore i hope that this (obviously something like a memory-leak) wasn't my fault. nevertheless i never found the real bug, but maybe miller found/fixed it already. i do think that this has to be done before we are able to continue in this direction, so who volunteers
mfg.dsf.sd IOhannes
|i once tried and added a method to canvases that destroyed them. |it did work, but only a few times (some 1000). after creating/destroying |1000s of obects pd was sure to crash. |i only changed the pd code slightly (some lines) and therefore i hope that |this (obviously something like a memory-leak) wasn't my fault. |nevertheless i never found the real bug, but maybe miller found/fixed it |already. |i do think that this has to be done before we are able to continue in this |direction, so who volunteers
so the bug also applies when in standard manual editing mode, adding and deleting objects ?
-- X Ð ¥ · 0 r g
I agree... there's no way (as yet, anyway) to get a pointer to the last created object in a patch (for instance) so taht you could store it and use it later to delete the object. Doing this well would be somewhat complicated and would make the "pointer", etc., objects run slower (stale pointer checking would be harder.)
An easier hack would be to give canvases a way to delete objects by numerical index... would that help?
cheers Miller
On Mon, Apr 30, 2001 at 04:32:57PM +0200, _-¯-_ wrote:
hi
|Does anyone know of a way to dynamically destroy an object using the |"send pd-xxx" approach? Also, is there anyway to disconnect objects |dynamically?
did you find/make anything? i ve only managed to selectall,menu_cut and start over from scratch. ;)
the problem with both destroying and disconnecting is getting the reference to the object. you could either emulate a mouseclick, or work out how to access the stuff via canvas/glist directly,
-- > < D ¥ . 0 R g
|I agree... there's no way (as yet, anyway) to get a pointer to the last |created object in a patch (for instance) so taht you could store it and use |it later to delete the object. Doing this well would be somewhat complicated |and would make the "pointer", etc., objects run slower (stale pointer checking |would be harder.) | |An easier hack would be to give canvases a way to delete objects by numerical |index... would that help?
that would totally help, since, given you re building patches from within pd, you have to keep track of the object-positions anyway, in order to make connections.
correct me if i have it totally wrong ..
-- I x Ð V . 0 R 6
That would be great. What would be really nice is to have destructors that are exact counterparts to the "obj" and "connect" ("destroy" and "disconnect"?) messages sent to canvases. This would make creating patches that use dynamic instanciation much easier. Also, one could conceivably build a GUI utilizing this (I'm almost considering doing this).