[PD] Is there a way to get the canvas my object is at runtime ?
chakekatzil at gmail.com
Tue Mar 3 21:21:22 CET 2015
You would only need to rewrite the function that max used (since it won't
exist otherwise anyway), and have it retrieve the value from the class
On Tue, Mar 3, 2015 at 2:26 PM, Antoine Villeret <antoine.villeret at gmail.com
> thanks for your answer, but I was wondering if there is a way to retrieve
> it without saving it.
> I'm porting a Max lib to Pd which uses such a thing in Max (which is
> possible since SDK 6).
> If it's not possible I would have to rewrite *a lot* of the lib code. :-(
> do it yourself
> 2015-03-03 19:52 GMT+01:00 Martin Peach <chakekatzil at gmail.com>:
>> You could save the pointer in your class struct during the new method.
>> On Tue, Mar 3, 2015 at 11:52 AM, Antoine Villeret <
>> antoine.villeret at gmail.com> wrote:
>>> I would like to retrieve at any time the pointer to the t_canvas
>>> containing my object.
>>> Is that possible ?
>>> I know I can retrieve it with something like :
>>> t_glist *glist=(t_glist *)canvas_getcurrent();
>>> t_canvas *canvas=(t_canvas*)glist_getcanvas(glist);
>>> in the myobject_new() method.
>>> But the same give me a (nil) t_canvas pointer outside the new() method.
>>> Thanks in advance.
>>> do it yourself
>>> Pd-list at lists.iem.at mailing list
>>> UNSUBSCRIBE and account-management ->
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pd-list