<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>personally, I like the mechanism of [iemguts/receivecanvas] where you specify the parent level from where to receive mouse events because it's quite flexible. one problem, though, is that GOPs are a bit awkward: you have to get the mouse position from the parent canvas and then substract the canvasposition to get coordinates relative to the GOP. you can even hack together mouse enter and leave events to create advanced widgets, but it involves quite a lot of thinking.</div>

<div> </div>

<div>
<div>maybe the iemguts approach with parent levels can be somehow combined with elegant GOP handling? for example, [iemguts/receivecanvas] will never send mouse events if GOP is enabled on the given parent (except when someone opens it via the context menu), so maybe in this case the object could report mouse events relative to the GOP area. working with parent levels has the advantage that you can freely choose the location within you patch structure, e.g. you can put it in a subpatch and you just have to increase the parent level by 1.</div>

<div> </div>

<div>Christof</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 14:28 Uhr<br/>
<b>Von:</b> "Dan Wilcox" <danomatika@gmail.com><br/>
<b>An:</b> "Christof Ressi" <christof.ressi@gmx.at><br/>
<b>Cc:</b> pd-dev <pd-dev@lists.iem.at>, "Chris McCormick" <chris@mccormick.cx><br/>
<b>Betreff:</b> Re: [PD-dev] local canvas-only pd_bind</div>

<div name="quoted-content">
<div>
<div>Some good ideas.</div>

<div> </div>

<div>I agree that GOP is basically a natural analogy to a tracking area already, so that might be a good place to look. Perhaps this can be rolled into the name canvas mechanism whereby a named canvas will receive mouse events when GOP is enabled?</div>
 

<blockquote><span style="font-family: monospace;">Hi Dan, thanks for looking into this! This is really, really needed.</span><br style="font-family: monospace;"/>
<br style="font-family: monospace;"/>
<span style="font-family: monospace;">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.</span><br/>
<br style="font-family: monospace;"/>
<span style="font-family: monospace;">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).</span><br style="font-family: monospace;"/>
<br style="font-family: monospace;"/>
<br style="font-family: monospace;"/>
<span style="font-family: monospace;">Christof</span></blockquote>

<div> 
<blockquote>
<blockquote>
<div>On Mar 17, 2019, at 1:38 PM, Dan Wilcox <<a href="mailto:danomatika@gmail.com" onclick="parent.window.location.href='mailto:danomatika@gmail.com'; return false;" target="_blank">danomatika@gmail.com</a>> wrote:</div>
 

<div><span style="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;text-decoration: none;float: none;display: inline;">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.</span>

<div style="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;text-decoration: none;"> </div>

<div style="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;text-decoration: none;"><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 style="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;text-decoration: none;">
<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>
</blockquote>

<blockquote>
<div>
<div style="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;text-decoration: none;">
<div>
<div>
<div style="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>
</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>
</div>
</div>
</div></div></body></html>