<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Hi Dan, thanks for looking into this! This is really, really needed.</div>

<div> </div>

<div>I think with the [mouse] object, [mousearea] can be easily created as a subpatch with GOP enabled, so I don't think we need a dedicated GUI object for that.</div>

<div> </div>

<div>regarding [cnv]: I think getting notifications for mouse clicks would be nice (in the past, people have faked this by putting other GUI objects below the canvas, but it's really clumsy).</div>

<div> </div>

<div>Christof</div>

<div> 
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Sonntag, 17. März 2019 um 13:38 Uhr<br/>
<b>Von:</b> "Dan Wilcox" <danomatika@gmail.com><br/>
<b>An:</b> "Chris McCormick" <chris@mccormick.cx><br/>
<b>Cc:</b> pd-dev <pd-dev@lists.iem.at><br/>
<b>Betreff:</b> Re: [PD-dev] local canvas-only pd_bind</div>

<div name="quoted-content">
<div>That's a similar concept to Cocoa's NSTrackingArea. It's basically a rectangle in a view that you attach which then receives mouse enter, leave, move, down, up, & drag events. You can update the position and size whenever.
<div> </div>

<div><a href="https://developer.apple.com/documentation/appkit/nstrackingarea?language=objc" target="_blank">https://developer.apple.com/documentation/appkit/nstrackingarea?language=objc</a></div>

<div>
<div> </div>

<div>I could imagine something similar in Pd, say a [mousearea] object. Also, updating [cnv] with similar functionality would be useful. [mousearea] could be used for arbitrary areas for control interaction and drawing of other objects while [cnv] could be used to create simple graphical regions for things like piano keys. I know there have been different approaches in this area, so it might be helpful to take a look (DesireData, PurrData, etc).</div>

<div> </div>

<div>I think this would complement a general, canvas wide set of [mouse] objects. I started by following the existing approach and split functionality into [mouse], [mouseup], and [mousemotion]. Another approach would be to use a single [mouse] object with a status symbol in addition to x & y.</div>

<div>
<div> 
<blockquote>
<div>On Mar 17, 2019, at 12:15 PM, Chris McCormick <<a href="mailto:chris@mccormick.cx" onclick="parent.window.location.href='mailto:chris@mccormick.cx'; return false;" target="_blank">chris@mccormick.cx</a>> wrote:</div>
 

<div><span style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;float: none;display: inline;">Hi Dan,</span><br style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;"/>
<br style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;"/>
<span style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;float: none;display: inline;">Thanks so much for looking at this.</span><br style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;"/>
<br style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;"/>
<span style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;float: none;display: inline;">What I really want as an end-user is to be able to know "has this particular rectangle received mouse-down, mouse-motion, or mouse-up?"</span><br style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;"/>
<br style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;"/>
<span style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;float: none;display: inline;">I think this would bring huge flexibility in allowing people to build complex user interfaces at the patch level. Things like ribbon controllers max/min selectors, click-and-hold buttons etc.</span><br style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;"/>
<br style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;"/>
<span style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;float: none;display: inline;">Cheers,</span><br style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;"/>
<br style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;"/>
<span style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;float: none;display: inline;">Chris.</span><br style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;"/>
<br style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;"/>
<span style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;float: none;display: inline;">On 16/3/19 10:01 am, Dan Wilcox wrote:</span>

<blockquote style="font-family: Monaco;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;text-decoration: none;">Howdy all,<br/>
I played around a bit with forwarding canvas mouse click events to a [mouse] object. This works fine using a bind to a global "#mouse" symbol, however this means all objects receive events from all canvases.<br/>
How can I change this to be local canvas only, as in only [mouse] objects within the canvas receive the events? I was thinking to generate a symbol with the canvas id ala how [openpanel] and [savepanel] work:<br/>
   <span class="Apple-converted-space"> </span>sprintf(buf, "d%lx", (t_int)x);<br/>
   <span class="Apple-converted-space"> </span>x->x_s = gensym(buf);<br/>
   <span class="Apple-converted-space"> </span>x->x_canvas = canvas_getcurrent();<br/>
   <span class="Apple-converted-space"> </span>pd_bind(&x->x_obj.ob_pd, x->x_s)<br/>
However, this means the canvas mouse function would need to generate the equivalent symbol each time the event is called in order to check if anything is bound to it. This seems wasteful. I suppose I could add a cached symbol somewhere, maybe to the g_canvas instance struct, however I'd like avoid that.<br/>
--------<br/>
Dan Wilcox</blockquote>
</div>
</blockquote>
</div>
 

<div>
<div style="color: rgb(0,0,0);font-family: Helvetica;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;">--------</div>

<div style="color: rgb(0,0,0);font-family: Helvetica;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;">Dan Wilcox</div>

<div style="color: rgb(0,0,0);font-family: Helvetica;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;"><a href="http://twitter.com/danomatika" target="_blank">@danomatika</a></div>

<div style="color: rgb(0,0,0);font-family: Helvetica;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;"><a href="http://danomatika.com" target="_blank">danomatika.com</a></div>

<div style="color: rgb(0,0,0);font-family: Helvetica;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;"><a href="http://robotcowboy.com" target="_blank">robotcowboy.com</a></div>

<div style="color: rgb(0,0,0);font-family: Helvetica;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;"> </div>
</div>
</div>
</div>
_______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.at <a href="https://lists.puredata.info/listinfo/pd-dev" target="_blank">https://lists.puredata.info/listinfo/pd-dev</a></div>
</div>
</div>
</div>
</div></div></body></html>