[PD] Is there a way to get the canvas my object is at runtime ?

Martin Peach chakekatzil at gmail.com
Tue Mar 3 19:52:13 CET 2015


You could save the pointer in your class struct during the new method.

Maritn

On Tue, Mar 3, 2015 at 11:52 AM, Antoine Villeret <
antoine.villeret at gmail.com> wrote:

> Hi,
>
> 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.
>
> Antoine
>
>
> --
> do it yourself
> http://antoine.villeret.free.fr
>
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20150303/c21bdac4/attachment-0001.html>


More information about the Pd-list mailing list