<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 03/03/2015 03:21 PM, Martin Peach
wrote:<br>
</div>
<blockquote
cite="mid:CAN5xZ3YkX2CwHw1d2Ru5Y0=DZes+Ys9+goZUEO81ujWSReH_AA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>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 struct instead.<br>
</div>
</div>
</div>
</blockquote>
<br>
And also add a line to your *_new method where you initialize the
t_canvas* field in your struct using canvas_getcurrent().<br>
<br>
-Jonathan<br>
<br>
<blockquote
cite="mid:CAN5xZ3YkX2CwHw1d2Ru5Y0=DZes+Ys9+goZUEO81ujWSReH_AA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
Martin<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Mar 3, 2015 at 2:26 PM, Antoine
Villeret <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:antoine.villeret@gmail.com" target="_blank">antoine.villeret@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">hi,
<div><br>
</div>
<div>thanks for your answer, but I was wondering if there
is a way to retrieve it without saving it.</div>
<div>I'm porting a Max lib to Pd which uses such a thing
in Max (which is possible since SDK 6).</div>
<div>If it's not possible I would have to rewrite *a lot*
of the lib code. :-(</div>
<div><br>
</div>
<div>+<span class="HOEnZb"><font color="#888888"><br>
a</font></span></div>
</div>
<div class="gmail_extra"><span class=""><br clear="all">
<div>
<div>--<br>
do it yourself <br>
<a moz-do-not-send="true"
href="http://antoine.villeret.free.fr"
target="_blank">http://antoine.villeret.free.fr</a><br>
</div>
</div>
<br>
</span>
<div>
<div class="h5">
<div class="gmail_quote">2015-03-03 19:52 GMT+01:00
Martin Peach <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:chakekatzil@gmail.com"
target="_blank">chakekatzil@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>You could save the pointer in your class
struct during the new method.<br>
<br>
</div>
Maritn<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">
<div>
<div>On Tue, Mar 3, 2015 at 11:52 AM,
Antoine Villeret <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:antoine.villeret@gmail.com"
target="_blank">antoine.villeret@gmail.com</a>></span>
wrote:<br>
</div>
</div>
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px
#ccc solid;padding-left:1ex">
<div>
<div>
<div dir="ltr">Hi,
<div><br>
</div>
<div>I would like to retrieve at any
time the pointer to the t_canvas
containing my object.</div>
<div>Is that possible ?</div>
<div>I know I can retrieve it with
something like : </div>
<div>
<div> t_glist *glist=(t_glist
*)canvas_getcurrent();</div>
<div> t_canvas
*canvas=(t_canvas*)glist_getcanvas(glist);</div>
</div>
<div>in the myobject_new() method.</div>
<div><br>
</div>
<div>But the same give me a (nil)
t_canvas pointer outside the new()
method.</div>
<div><br>
</div>
<div>Thanks in advance.</div>
<div><br>
</div>
<div>Antoine</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>
<div>--<br>
do it yourself
<br>
<a moz-do-not-send="true"
href="http://antoine.villeret.free.fr"
target="_blank">http://antoine.villeret.free.fr</a><br>
</div>
</div>
</div>
</div>
<br>
</div>
</div>
_______________________________________________<br>
<a moz-do-not-send="true"
href="mailto:Pd-list@lists.iem.at"
target="_blank">Pd-list@lists.iem.at</a>
mailing list<br>
UNSUBSCRIBE and account-management -> <a
moz-do-not-send="true"
href="http://lists.puredata.info/listinfo/pd-list"
target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
<a class="moz-txt-link-abbreviated" href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list
UNSUBSCRIBE and account-management -> <a class="moz-txt-link-freetext" href="http://lists.puredata.info/listinfo/pd-list">http://lists.puredata.info/listinfo/pd-list</a>
</pre>
</blockquote>
<br>
</body>
</html>