<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hilaire,</p>
<p><br /></p>
<p>I take it back. </p>
<p><br /></p>
<p>There are events that a Morph handles which it makes sense to specialize/override for an individual morph.</p>
<p>But dragEvent:MorphPosition: is an action one typically does not override. </p>
<p>It's callers are #MouseEvent>>dispatchWith: -- which you probably don't want to mess with -- and specializations of #Morph>>mouseButton1Down:localPosition: which you can already override.</p>
<p><br /></p>
<p>HTH,</p>
<p>-KenD</p>
<p><br /></p>
<p><br /></p>
<p>On 2025-02-08 04:02, Hilaire Fernandes via Cuis-dev wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --> <!-- head ignored --><!-- meta ignored -->
<p><span style="font-size: large;">Is there any reason drag event is not implemented as a property?<br /> </span></p>
<p><br /></p>
<div style="background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .1em .6em;">
<table>
<tbody>
<tr>
<td>
<pre style="margin: 0; line-height: 125%;">1
2
3
4</pre>
</td>
<td>
<pre style="margin: 0; line-height: 125%;"><span style="color: #bb0066; font-weight: bold;">Morph</span><span style="color: #0066bb; font-weight: bold;">>>dragEvent:</span> <span style="color: #996633;">aMouseEvent</span> <span style="color: #0066bb; font-weight: bold;">localPosition:</span> <span style="color: #996633;">aPoint</span>

        <span style="color: #996633;">aMouseEvent</span> <span style="color: #0066bb; font-weight: bold;">hand</span> <span style="color: #0066bb; font-weight: bold;">halo:</span> <span style="color: #007020;">nil</span>.
        <span style="color: #996633;">aMouseEvent</span> <span style="color: #0066bb; font-weight: bold;">hand</span> <span style="color: #0066bb; font-weight: bold;">grabMorph:</span> <span style="color: #007020;">self</span>
</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p><span style="font-size: large;">contrary to other mouse events as :<br /> </span></p>
<p><br /></p>
<div style="background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .1em .6em;">
<table>
<tbody>
<tr>
<td>
<pre style="margin: 0; line-height: 125%;">1
2
3
4
5
6
7
8</pre>
</td>
<td>
<pre style="margin: 0; line-height: 125%;"><span style="color: #bb0066; font-weight: bold;">Morph</span><span style="color: #0066bb; font-weight: bold;">>>mouseButton1Down:</span> <span style="color: #996633;">aMouseButtonEvent</span> <span style="color: #0066bb; font-weight: bold;">localPosition:</span> <span style="color: #996633;">localEventPosition</span>
        <span style="color: #888888;">"Handle a mouse down event.</span>
<span style="color: #888888;">  This message will only be sent to Morphs that answer true to #handlesMouseDown:"</span>

        <span style="color: #888888;">"Allow instances to dynamically use properties for handling common events."</span>
        <span style="color: #007020;">self</span> 
                <span style="color: #0066bb; font-weight: bold;">valueOfProperty:</span> <span style="color: #ff0000; background-color: #ffaaaa;">#</span><span style="background-color: #fff0f0;">'<a class="moz-txt-link-freetext" href="mouseButton1Down:localPosition" target="_blank" rel="noopener noreferrer">mouseButton1Down:localPosition</a>:'</span> 
                <span style="color: #0066bb; font-weight: bold;">ifPresentDo:</span> [ <span style="color: #333333;">:</span><span style="color: #996633;">handler</span> <span style="color: #333333;">|</span> <span style="color: #996633;">handler</span> <span style="color: #0066bb; font-weight: bold;">value:</span> <span style="color: #996633;">aMouseButtonEvent</span> <span style="color: #0066bb; font-weight: bold;">value:</span> <span style="color: #996633;">localEventPosition</span> ]
</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p><span style="font-size: large;">If I am right it makes impossible to add programmatically drag event handler to arbitrary Morph. You will have to subclass such Morph to add the behavior you want.</span></p>
<p><span style="font-size: large;">Am I right or do I miss something?</span></p>
<p><span style="font-size: large;">Thanks<br /> </span></p>
<pre class="moz-signature">-- 
<a class="moz-txt-link-freetext" href="http://mamot.fr/@drgeo" target="_blank" rel="noopener noreferrer">http://mamot.fr/@drgeo</a></pre>
<!-- html ignored --><br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"> </div>
</blockquote>
<p><br /></p>

</body></html>