Hi Alistair,
the error messages from Rubric-Components, if there occured an error is
often misleading.

I added this act-on-move-functionality for highlighting message sends and I
forgot to respect to full TextAction hierarchy
(I only implemented the
actOnMove: anEvent for: target in: aParagraph editor: anEditor
method for TextLink and TextMethodLink and not for TextAction)

You can solve this by moving the implementation
actOnMove: anEvent for: target in: aParagraph editor: anEditor
    "override in subclasses"
    ^ false

from TextLink, up to TextAction.


nicolai


2017-02-07 6:37 GMT+01:00 Alistair Grant <akgrant0...@gmail.com>:

> Hi All,
>
> I'm attempting to port some code that works in Pharo 5 to Pharo 6 and
> have hit a problem when attempting to inspect text.
>
> Inspecting the following:
>
>
> | text |
>
> text := Text fromString: 'Hello World'.
> text addAttribute: (TextAction new actOnClickBlock: [ self halt ])
> from: 1 to: 5.
> text.
>
>
> And then moving the mouse over the text causes the traceback
> included below in Pharo 6, but is fine in Pharo 5.
>
> I think the problem was introduced as part of
> SLICE-Issue-18901-Highlight-message-send-selector-on-
> mouse-over-NicolaiHess.4
> in RubAbstractTextArea>>mouseMove: where the line:
>
>    self paragraph move: evt for: model controller: self editor.
>
> was added to the start of the method.
>
> I'm not familiar with this code, so it would be great if someone
> (Nicolai? :-)) who has a better understanding of the original intention
> can offer a suggested fix.
>
> Removing the addition appears to resolve the problem, although I expect
> it introduces other unwanted side effects, and the remainder of the
> method was also refactored.
>
> Thanks!
> Alistair
>
>
> RubCurrentLineBarDecorator(Object)>>doesNotUnderstand:
> #move:for:controller:
> [ super doesNotUnderstand: aMessage ] in
> RubCurrentLineBarDecorator(RubParagraphDecorator)>>doesNotUnderstand:
> #move:for:controller:
> BlockClosure>>cull:
> Context>>evaluateSignal:
> Context>>handleSignal:
> MessageNotUnderstood(Exception)>>signal
> RubExtraSelectionDecorator(Object)>>doesNotUnderstand:
> #move:for:controller:
> [ super doesNotUnderstand: aMessage ] in
> RubExtraSelectionDecorator(RubParagraphDecorator)>>doesNotUnderstand:
> #move:for:controller:
> BlockClosure>>cull:
> Context>>evaluateSignal:
> Context>>handleSignal:
> MessageNotUnderstood(Exception)>>signal
> RubOpeningClosingDelimiterDecorator(Object)>>doesNotUnderstand:
> #move:for:controller:
> [ super doesNotUnderstand: aMessage ] in
> RubOpeningClosingDelimiterDecorator(RubParagraphDecorator)>>
> doesNotUnderstand:
> #move:for:controller:
> BlockClosure>>cull:
> Context>>evaluateSignal:
> Context>>handleSignal:
> MessageNotUnderstood(Exception)>>signal
> TextAction(Object)>>doesNotUnderstand: #actOnMove:for:in:editor:
> [ :attribute |
> | target |
> "evaluate the attribute action"
> target := model ifNil: [ textArea ].
> (attribute
> actOnMove: anEvent
> for: target
> in: self
> editor: editor) == true
> ifTrue: [ ^ true ] ] in RubParagraph>>move:for:controller:
> BlockClosure>>cull:
> BlockClosure>>cull:cull:
> [ :attribute |
> | range boxes |
> "find the boxes for the current attribute range"
> range := self text
> rangeOf: attribute
> startingAt: startBlock stringIndex.
> boxes := self
> selectionRectsFrom: (self characterBlockForIndex: range first)
> to: (self characterBlockForIndex: range last + 1).
> (boxes
> detect: [ :each | each containsPoint: aClickPoint ]
> ifNone: [ nil ]) ifNotNil: [ aBlock cull: attribute cull: boxes ] ] in
> RubParagraph>>actionAttributesUnder:event:do:
> Array(SequenceableCollection)>>select:thenDo:
> RubParagraph>>actionAttributesUnder:event:do:
> RubParagraph>>move:for:controller:
> Message>>sendTo:
> [ aMessage sendTo: next ] in
> RubOpeningClosingDelimiterDecorator(RubParagraphDecorator)>>
> doesNotUnderstand:
> #move:for:controller:
> BlockClosure>>on:do:
> RubOpeningClosingDelimiterDecorator(RubParagraphDecorator)>>
> doesNotUnderstand:
> #move:for:controller:
> Message>>sendTo:
> [ aMessage sendTo: next ] in
> RubExtraSelectionDecorator(RubParagraphDecorator)>>doesNotUnderstand:
> #move:for:controller:
> BlockClosure>>on:do:
> RubExtraSelectionDecorator(RubParagraphDecorator)>>doesNotUnderstand:
> #move:for:controller:
> Message>>sendTo:
> [ aMessage sendTo: next ] in
> RubCurrentLineBarDecorator(RubParagraphDecorator)>>doesNotUnderstand:
> #move:for:controller:
> BlockClosure>>on:do:
> RubCurrentLineBarDecorator(RubParagraphDecorator)>>doesNotUnderstand:
> #move:for:controller:
> RubEditingArea(RubAbstractTextArea)>>mouseMove:
> RubEditingArea>>mouseMove:
> RubEditingArea(RubAbstractTextArea)>>handleMouseMove:
> MouseMoveEvent>>sentTo:
> RubEditingArea(Morph)>>handleEvent:
> MorphicEventDispatcher>>dispatchDefault:with:
> MorphicEventDispatcher>>handleMouseMove:
> MouseMoveEvent>>sentTo:
> [ ^ anEvent sentTo: self ] in MorphicEventDispatcher>>dispatchEvent:with:
> BlockClosure>>ensure:
> MorphicEventDispatcher>>dispatchEvent:with:
> RubEditingArea(Morph)>>processEvent:using:
> MorphicEventDispatcher>>dispatchDefault:with:
> MorphicEventDispatcher>>handleMouseMove:
> MouseMoveEvent>>sentTo:
> [ ^ anEvent sentTo: self ] in MorphicEventDispatcher>>dispatchEvent:with:
> BlockClosure>>ensure:
> MorphicEventDispatcher>>dispatchEvent:with:
> TransformWithLayoutMorph(Morph)>>processEvent:using:
> MorphicEventDispatcher>>dispatchDefault:with:
> MorphicEventDispatcher>>handleMouseMove:
> MouseMoveEvent>>sentTo:
> [ ^ anEvent sentTo: self ] in MorphicEventDispatcher>>dispatchEvent:with:
> BlockClosure>>ensure:
> MorphicEventDispatcher>>dispatchEvent:with:
> RubTextScrollPane(Morph)>>processEvent:using:
> MorphicEventDispatcher>>dispatchDefault:with:
> MorphicEventDispatcher>>handleMouseMove:
> MouseMoveEvent>>sentTo:
> [ ^ anEvent sentTo: self ] in MorphicEventDispatcher>>dispatchEvent:with:
> BlockClosure>>ensure:
> MorphicEventDispatcher>>dispatchEvent:with:
> RubScrolledTextMorph(Morph)>>processEvent:using:
> MorphicEventDispatcher>>dispatchDefault:with:
> MorphicEventDispatcher>>handleMouseMove:
> MouseMoveEvent>>sentTo:
> [ ^ anEvent sentTo: self ] in MorphicEventDispatcher>>dispatchEvent:with:
> BlockClosure>>ensure:
> MorphicEventDispatcher>>dispatchEvent:with:
> PanelMorph(Morph)>>processEvent:using:
> MorphicEventDispatcher>>dispatchDefault:with:
> MorphicEventDispatcher>>handleMouseMove:
> MouseMoveEvent>>sentTo:
> [ ^ anEvent sentTo: self ] in MorphicEventDispatcher>>dispatchEvent:with:
> BlockClosure>>ensure:
> MorphicEventDispatcher>>dispatchEvent:with:
> LazyTabGroupMorph(Morph)>>processEvent:using:
> MorphicEventDispatcher>>dispatchDefault:with:
> MorphicEventDispatcher>>handleMouseMove:
> MouseMoveEvent>>sentTo:
> [ ^ anEvent sentTo: self ] in MorphicEventDispatcher>>dispatchEvent:with:
> BlockClosure>>ensure:
> MorphicEventDispatcher>>dispatchEvent:with:
> PanelMorph(Morph)>>processEvent:using:
> MorphicEventDispatcher>>dispatchDefault:with:
> MorphicEventDispatcher>>handleMouseMove:
> MouseMoveEvent>>sentTo:
> [ ^ anEvent sentTo: self ] in MorphicEventDispatcher>>dispatchEvent:with:
> BlockClosure>>ensure:
> MorphicEventDispatcher>>dispatchEvent:with:
> PanelMorph(Morph)>>processEvent:using:
> MorphicEventDispatcher>>dispatchDefault:with:
> MorphicEventDispatcher>>handleMouseMove:
> MouseMoveEvent>>sentTo:
> [ ^ anEvent sentTo: self ] in MorphicEventDispatcher>>dispatchEvent:with:
> BlockClosure>>ensure:
> MorphicEventDispatcher>>dispatchEvent:with:
> LazyTabGroupMorph(Morph)>>processEvent:using:
> MorphicEventDispatcher>>dispatchDefault:with:
> MorphicEventDispatcher>>handleMouseMove:
> MouseMoveEvent>>sentTo:
> [ ^ anEvent sentTo: self ] in MorphicEventDispatcher>>dispatchEvent:with:
> BlockClosure>>ensure:
> MorphicEventDispatcher>>dispatchEvent:with:
> PanelMorph(Morph)>>processEvent:using:
> MorphicEventDispatcher>>dispatchDefault:with:
> MorphicEventDispatcher>>handleMouseMove:
> MouseMoveEvent>>sentTo:
> [ ^ anEvent sentTo: self ] in MorphicEventDispatcher>>dispatchEvent:with:
> BlockClosure>>ensure:
> MorphicEventDispatcher>>dispatchEvent:with:
> GLMMorphBrick(Morph)>>processEvent:using:
> MorphicEventDispatcher>>dispatchDefault:with:
> MorphicEventDispatcher>>handleMouseMove:
> MouseMoveEvent>>sentTo:
> [ ^ anEvent sentTo: self ] in MorphicEventDispatcher>>dispatchEvent:with:
> BlockClosure>>ensure:
> MorphicEventDispatcher>>dispatchEvent:with:
> GLMScrollPaneBandBrick(Morph)>>processEvent:using:
> MorphicEventDispatcher>>dispatchDefault:with:
> MorphicEventDispatcher>>handleMouseMove:
> MouseMoveEvent>>sentTo:
> [ ^ anEvent sentTo: self ] in MorphicEventDispatcher>>dispatchEvent:with:
> BlockClosure>>ensure:
> MorphicEventDispatcher>>dispatchEvent:with:
> GLMPagerScrollBrick(Morph)>>processEvent:using:
> MorphicEventDispatcher>>dispatchDefault:with:
> MorphicEventDispatcher>>handleMouseMove:
> MouseMoveEvent>>sentTo:
> [ ^ anEvent sentTo: self ] in MorphicEventDispatcher>>dispatchEvent:with:
> BlockClosure>>ensure:
> MorphicEventDispatcher>>dispatchEvent:with:
> GLMPagerBrick(Morph)>>processEvent:using:
> MorphicEventDispatcher>>dispatchDefault:with:
> MorphicEventDispatcher>>handleMouseMove:
> MouseMoveEvent>>sentTo:
> [ ^ anEvent sentTo: self ] in MorphicEventDispatcher>>dispatchEvent:with:
> BlockClosure>>ensure:
> MorphicEventDispatcher>>dispatchEvent:with:
> GLMFoundationBrick(Morph)>>processEvent:using:
> MorphicEventDispatcher>>dispatchDefault:with:
> MorphicEventDispatcher>>handleMouseMove:
> MouseMoveEvent>>sentTo:
> [ ^ anEvent sentTo: self ] in MorphicEventDispatcher>>dispatchEvent:with:
> BlockClosure>>ensure:
> MorphicEventDispatcher>>dispatchEvent:with:
> GLMSystemWindow(Morph)>>processEvent:using:
> MorphicEventDispatcher>>dispatchDefault:with:
> MorphicEventDispatcher>>handleMouseMove:
> MouseMoveEvent>>sentTo:
> [ ^ anEvent sentTo: self ] in MorphicEventDispatcher>>dispatchEvent:with:
> BlockClosure>>ensure:
> MorphicEventDispatcher>>dispatchEvent:with:
> WorldMorph(Morph)>>processEvent:using:
> WorldMorph(Morph)>>processEvent:
> HandMorph>>sendEvent:focus:clear:
> HandMorph>>sendMouseEvent:
> HandMorph>>handleEvent:
> HandMorph>>processEventsFromQueue:
> HandMorph>>processEvents
> [ :h |
> self activeHand: h.
> h processEvents.
> self activeHand: nil ] in WorldState>>doOneCycleNowFor:
> Array(SequenceableCollection)>>do:
> WorldState>>handsDo:
> WorldState>>doOneCycleNowFor:
> WorldState>>doOneCycleFor:
> WorldMorph>>doOneCycle
> WorldMorph class>>doOneCycle
> [ [ WorldMorph doOneCycle.
> Processor yield.
> false ] whileFalse: [  ] ] in MorphicUIManager>>spawnNewProcess
> [ self value.
> Processor terminateActive ] in BlockClosure>>newProcess
>
>

Reply via email to