<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><font size="4">Hi, <br>
</font></p>
<p><font size="4">I have this situation where an <b>objectA</b> can
emit event with a default argument (</font><b><font
color="#a51d2d">self</font></b><font size="4">):</font></p>
<blockquote>
<pre><font size="4">FilePreviewMorph>>doubleClick: event localPosition: position</font>
<font size="4"> self triggerEvent: #doubleClick with: <b><font
color="#a51d2d">self
</font></b></font></pre>
</blockquote>
<p><font size="4">And the listening <b>objectB</b> wants to be
notified with a different argument (</font><font color="#a51d2d"><b>fileEntry</b></font><font
size="4">)</font></p>
<blockquote>
<pre><font size="4">fileView when: #doubleClick send: #open: to: self with: <b><font
color="#a51d2d">fileEntry</font></b>].
</font></pre>
</blockquote>
<p><font size="4">However when the event is triggered in <b>objectA</b>
the optional prefered argument by <b>objectB</b> (fileEntry) is
not used. It is still the <b>self</b> argument.</font></p>
<p><font size="4">Is it the expected behavior?<br>
</font></p>
<p></p>
<p><font size="4">The behavior is revealed here:</font></p>
<p><font size="4"><img src="cid:part1.eWXW1oWU.pn80dA0v@free.fr"
alt=""></font></p>
<p><font size="4"><br>
</font></p>
<p><font size="4"><font face="monospace">arguments</font> contains
the fileEntry but it is ignored as show the value of <font
face="monospace">argsToUse</font>.</font></p>
<p><font size="4">Change in method bellow adjust this behavior. Not
sure it is what is expected.<br>
</font></p>
<pre><font size="4">collectArguments: anArgArray
"Private"
| staticArgs |
staticArgs := self arguments.
^(anArgArray size = staticArgs size)
ifTrue: [</font><font size="4"><b>staticArgs asNewArra</b></font><font
size="4">]
ifFalse:
[(staticArgs isEmpty
ifTrue: [ staticArgs := Array new: selector numArgs]
ifFalse: [staticArgs asNewArray] )
replaceFrom: 1
to: (anArgArray size min: staticArgs size)
with: anArgArray
startingAt: 1]
</font></pre>
<pre><font size="4">
</font></pre>
<p><font size="4">Thanks</font></p>
<p><font size="4">Hilaire<br>
</font></p>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://mamot.fr/@drgeo">http://mamot.fr/@drgeo</a></pre>
</body>
</html>