[Pharo-project] problem with TextMorph>>handleInteraction:fromEvent:
Hi, I'm working to make Algernon works on pharo, and I found what seems to be a bug (or at least something that "revesls" a bug), in TextMorph>>handleInteraction: This is what happens: the Algernon starts and you type a class, then go inside to look for a method, and that sends a keyStroke: to a new TextMorph, who sends a #handleInteraction:fromEvent:. So... old implementation on #handleInteraction:fromEvent: had a first line removed in new implementation: self editor sensor: (KeyboardBuffer new startingEvent: evt). The problem is this: #editor message instances editor attribute if nil. Now... that line is not anymore, introducing a DNU when sending a subsecuent message to editor attribute. I "solved" it bu changing this line: oldEditor := editor. for this other: oldEditor := self editor. (who restores the editor instantiation). What I don't know is: a) is this a bug? b) the bug is there or is a collateral damage? c) my hack really solves the problem? d) is possible to introduce this bugfix into a new version? Cheers, Esteban
Ouch, bad method, please replace: #handleInteraction:fromEvent: (the squeak event), for #handleInteraction: (the pharo equivallent) Cheers, Esteban On 2009-07-12 11:22:47 -0300, Esteban Lorenzano <estebanlm@gmail.com> said:
Hi, I'm working to make Algernon works on pharo, and I found what seems to be a bug (or at least something that "revesls" a bug), in TextMorph>>handleInteraction: This is what happens: the Algernon starts and you type a class, then go inside to look for a method, and that sends a keyStroke: to a new TextMorph, who sends a #handleInteraction:fromEvent:. So... old implementation on #handleInteraction:fromEvent: had a first line removed in new implementation:
self editor sensor: (KeyboardBuffer new startingEvent: evt).
The problem is this: #editor message instances editor attribute if nil. Now... that line is not anymore, introducing a DNU when sending a subsecuent message to editor attribute. I "solved" it bu changing this line:
oldEditor := editor.
for this other:
oldEditor := self editor.
(who restores the editor instantiation).
What I don't know is:
a) is this a bug? b) the bug is there or is a collateral damage? c) my hack really solves the problem? d) is possible to introduce this bugfix into a new version?
Cheers, Esteban
do you have a cs? Stef On Jul 12, 2009, at 4:25 PM, Esteban Lorenzano wrote:
Ouch, bad method, please replace: #handleInteraction:fromEvent: (the squeak event), for #handleInteraction: (the pharo equivallent)
Cheers, Esteban
On 2009-07-12 11:22:47 -0300, Esteban Lorenzano <estebanlm@gmail.com> said:
Hi, I'm working to make Algernon works on pharo, and I found what seems to be a bug (or at least something that "revesls" a bug), in TextMorph>>handleInteraction: This is what happens: the Algernon starts and you type a class, then go inside to look for a method, and that sends a keyStroke: to a new TextMorph, who sends a #handleInteraction:fromEvent:. So... old implementation on #handleInteraction:fromEvent: had a first line removed in new implementation:
self editor sensor: (KeyboardBuffer new startingEvent: evt).
The problem is this: #editor message instances editor attribute if nil. Now... that line is not anymore, introducing a DNU when sending a subsecuent message to editor attribute. I "solved" it bu changing this line:
oldEditor := editor.
for this other:
oldEditor := self editor.
(who restores the editor instantiation).
What I don't know is:
a) is this a bug? b) the bug is there or is a collateral damage? c) my hack really solves the problem? d) is possible to introduce this bugfix into a new version?
Cheers, Esteban
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
in TextMorph I do not see this method On Jul 12, 2009, at 4:25 PM, Esteban Lorenzano wrote:
Ouch, bad method, please replace: #handleInteraction:fromEvent: (the squeak event), for #handleInteraction: (the pharo equivallent)
Cheers, Esteban
On 2009-07-12 11:22:47 -0300, Esteban Lorenzano <estebanlm@gmail.com> said:
Hi, I'm working to make Algernon works on pharo, and I found what seems to be a bug (or at least something that "revesls" a bug), in TextMorph>>handleInteraction: This is what happens: the Algernon starts and you type a class, then go inside to look for a method, and that sends a keyStroke: to a new TextMorph, who sends a #handleInteraction:fromEvent:. So... old implementation on #handleInteraction:fromEvent: had a first line removed in new implementation:
self editor sensor: (KeyboardBuffer new startingEvent: evt).
The problem is this: #editor message instances editor attribute if nil. Now... that line is not anymore, introducing a DNU when sending a subsecuent message to editor attribute. I "solved" it bu changing this line:
oldEditor := editor.
for this other:
oldEditor := self editor.
(who restores the editor instantiation).
What I don't know is:
a) is this a bug? b) the bug is there or is a collateral damage? c) my hack really solves the problem? d) is possible to introduce this bugfix into a new version?
Cheers, Esteban
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
On Sun, Jul 12, 2009 at 4:22 PM, Esteban Lorenzano<estebanlm@gmail.com> wrote:
What I don't know is:
a) is this a bug? b) the bug is there or is a collateral damage? c) my hack really solves the problem? d) is possible to introduce this bugfix into a new version?
This part was refactored, the variable editor shouldn't be used anymore IIRC. Michael
Oops I checked and the code is full of editor direct accesses Stef On Jul 12, 2009, at 5:06 PM, Michael Rueger wrote:
On Sun, Jul 12, 2009 at 4:22 PM, Esteban Lorenzano<estebanlm@gmail.com> wrote:
What I don't know is:
a) is this a bug? b) the bug is there or is a collateral damage? c) my hack really solves the problem? d) is possible to introduce this bugfix into a new version?
This part was refactored, the variable editor shouldn't be used anymore IIRC.
Michael
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
On 2009-07-12 12:06:46 -0300, Michael Rueger <m.rueger@acm.org> said:
On Sun, Jul 12, 2009 at 4:22 PM, Esteban Lorenzano<estebanlm@gmail.com> wrote:
What I don't know is:
a) is this a bug? b) the bug is there or is a collateral damage? c) my hack really solves the problem? d) is possible to introduce this bugfix into a new version?
This part was refactored, the variable editor shouldn't be used anymore IIRC.
Michael
But there are several places in TextMorph using it :(
participants (3)
-
Esteban Lorenzano -
Michael Rueger -
Stéphane Ducasse