[Pharo-dev] TextAttribute, TextAction and TextDoIt or TextURL: not working

Sean P. DeNigris sean at clipperadams.com
Tue Nov 5 15:33:35 EST 2013


philippeback wrote
> doing:
> 
> ((Text withAll: 'foo') , (Text string: 'some link' attribute: (TextURL new
> url:'http://philippeback.eu')) , (Text withAll: 'bar')) asMorph
> openInWorld.
> 
> gives me a nice purple 'some link' bit but clicking on it fails with
> 
> MessageNotUnderstood: TextURL>>actOnClick:for:in:editor:

Issue 12075: Fix TextActions and Add SourceWebBrowser for TextUrl

Fix in inbox: TextDoIt, TextPrintIt, PluggableTextAttribute, and TextURL now
work. This fix also adds a SourceWebBrowser, which simply opens the page
source in a Workspace, and registers it under "tools webBrowser". The idea
is that e.g. ExternalWebBrowser or another external project could override
this very basic functionality.

I'm also attaching the .cs to Nabble  TextActions.cs
<http://forum.world.st/file/n4719448/TextActions.cs>   in case you want it
in pre-3.0 (tested in 2.0).

To test:

ws := Workspace openContents: 'Transcript open'.
wsWindow := World submorphs detect: [ :e | e model == ws ].
wsTextMorph := wsWindow findDeeplyA: TextMorph.
text := wsTextMorph text.
attr := TextDoIt evalString: text.
text addAttribute: attr.
 
ws := Workspace openContents: '1 + 1'.
wsWindow := World submorphs detect: [ :e | e model == ws ].
wsTextMorph := wsWindow findDeeplyA: TextMorph.
text := wsTextMorph text.
attr := PluggableTextAttribute evalBlock: [ :e | e contents: '' ].
text addAttribute: attr.
 
ws := Workspace openContents: '1 + 1'.
wsWindow := World submorphs detect: [ :e | e model == ws ].
wsTextMorph := wsWindow findDeeplyA: TextMorph.
text := wsTextMorph text.
attr := TextPrintIt evalString: text.
text addAttribute: attr.
 
ws := Workspace openContents: '1 + 1'.
wsWindow := World submorphs detect: [ :e | e model == ws ].
wsTextMorph := wsWindow findDeeplyA: TextMorph.
text := wsTextMorph text.
attr := TextURL new url: 'http://www.google.com';.
text addAttribute: attr.



-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/TextAttribute-TextAction-and-TextDoIt-or-TextURL-not-working-tp4543978p4719448.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.




More information about the Pharo-dev mailing list