[Pharo-project] TextAttribute, TextAction and TextDoIt or TextURL: not working
I've been investigating with text. I found things that do work like: ((Text withAll: 'foo') , (Text string: '*' attribute: (TextAnchor new anchoredMorph: EllipseMorph new)) , (Text withAll: 'bar')) asMorph openInWorld. ((Text withAll: 'foo') , (Text string: '*' attribute: (TextAnchor new anchoredMorph: ThemeIcons confirmIcon)) , (Text withAll: 'bar')) asMorph openInWorld. But 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: Damn! Ideas on how to tackle this? TIA Philippe Back
On Mon, Apr 9, 2012 at 2:56 PM, phil@highoctane.be <phil@highoctane.be>wrote:
I've been investigating with text.
I found things that do work like:
((Text withAll: 'foo') , (Text string: '*' attribute: (TextAnchor new anchoredMorph: EllipseMorph new)) , (Text withAll: 'bar')) asMorph openInWorld.
((Text withAll: 'foo') , (Text string: '*' attribute: (TextAnchor new anchoredMorph: ThemeIcons confirmIcon)) , (Text withAll: 'bar')) asMorph openInWorld.
But 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:
Damn! Ideas on how to tackle this?
Take a look at the Squeak code? There I see TextURL implements actOnClickFor: not the 4 arg method. So perhaps the dispatcher has been changed to no longer support the one-argument form. you could either change the one-arg method into the longer form or fix the dispatcher.
TIA Philippe Back
-- best, Eliot
I introduced a new 4 arg protocol for the semantic source links. the old single arg protocol is not that useful since it doesn't allow for dispatching back over the editor... For a proper implementation of the new protocol check one of the TextLink subclasses, for instance: TextClassLink>>#actOnClick:for:in:editor: On OSX/Linux I would simply use OSProcess to open a URL in the system's default browser On 2012-04-10, at 00:55, Eliot Miranda wrote:
On Mon, Apr 9, 2012 at 2:56 PM, phil@highoctane.be <phil@highoctane.be> wrote: I've been investigating with text.
I found things that do work like:
((Text withAll: 'foo') , (Text string: '*' attribute: (TextAnchor new anchoredMorph: EllipseMorph new)) , (Text withAll: 'bar')) asMorph openInWorld.
((Text withAll: 'foo') , (Text string: '*' attribute: (TextAnchor new anchoredMorph: ThemeIcons confirmIcon)) , (Text withAll: 'bar')) asMorph openInWorld.
But 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:
Damn! Ideas on how to tackle this?
Take a look at the Squeak code? There I see TextURL implements actOnClickFor: not the 4 arg method. So perhaps the dispatcher has been changed to no longer support the one-argument form. you could either change the one-arg method into the longer form or fix the dispatcher.
TIA Philippe Back
-- best, Eliot
Ok. The point is to create buttons or shapes or figures in the text for a game I am making. I want it to run on the iOS vm. So the has nothing to do with osprocess. Just a sample action for text. Le 10 avr. 2012 15:09, "Camillo Bruni" <camillobruni@gmail.com> a écrit :
I introduced a new 4 arg protocol for the semantic source links. the old single arg protocol is not that useful since it doesn't allow for dispatching back over the editor...
For a proper implementation of the new protocol check one of the TextLink subclasses, for instance: TextClassLink>>#actOnClick:for:in:editor:
On OSX/Linux I would simply use OSProcess to open a URL in the system's default browser
On 2012-04-10, at 00:55, Eliot Miranda wrote:
On Mon, Apr 9, 2012 at 2:56 PM, phil@highoctane.be <phil@highoctane.be>
wrote:
I've been investigating with text.
I found things that do work like:
((Text withAll: 'foo') , (Text string: '*' attribute: (TextAnchor new anchoredMorph: EllipseMorph new)) , (Text withAll: 'bar')) asMorph openInWorld.
((Text withAll: 'foo') , (Text string: '*' attribute: (TextAnchor new anchoredMorph: ThemeIcons confirmIcon)) , (Text withAll: 'bar')) asMorph openInWorld.
But 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:
Damn! Ideas on how to tackle this?
Take a look at the Squeak code? There I see TextURL implements actOnClickFor: not the 4 arg method. So perhaps the dispatcher has been changed to no longer support the one-argument form. you could either change the one-arg method into the longer form or fix the dispatcher.
TIA Philippe Back
-- best, Eliot
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-w... Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
,Ooooohhh!!!! I guess I'll restart work on that old 1.3-based project of mine :-) Well, well,this opens a lot of doors! (including doc comments with links inside them for clickable cross refs, like we had in squeak) Now, it is going to be used with Tx stuff ? Phil
On 5 November 2013 22:56, phil@highoctane.be <phil@highoctane.be> wrote:
,Ooooohhh!!!!
I guess I'll restart work on that old 1.3-based project of mine :-)
Well, well,this opens a lot of doors! (including doc comments with links inside them for clickable cross refs, like we had in squeak)
Now, it is going to be used with Tx stuff ?
Phil
Short answer: no. Long answer: we looking forward to provide similar (or even better :) ) functionality. -- Best regards, Igor Stasenko.
Aaaah ;-) Hypertext abilities: a must have, especially since we'll have that super AST-style source code thingy in Pharo4. --- Philippe Back Dramatic Performance Improvements Mob: +32(0) 478 650 140 | Fax: +32 (0) 70 408 027 Mail:phil@highoctane.be | Web: http://philippeback.eu Blog: http://philippeback.be | Twitter: @philippeback Youtube: http://www.youtube.com/user/philippeback/videos High Octane SPRL rue cour Boisacq 101 | 1301 Bierges | Belgium Pharo Consortium Member - http://consortium.pharo.org/ Featured on the Software Process and Measurement Cast - http://spamcast.libsyn.com Sparx Systems Enterprise Architect and Ability Engineering EADocX Value Added Reseller On Wed, Nov 6, 2013 at 11:22 AM, Igor Stasenko <siguctua@gmail.com> wrote:
On 5 November 2013 22:56, phil@highoctane.be <phil@highoctane.be> wrote:
,Ooooohhh!!!!
I guess I'll restart work on that old 1.3-based project of mine :-)
Well, well,this opens a lot of doors! (including doc comments with links inside them for clickable cross refs, like we had in squeak)
Now, it is going to be used with Tx stuff ?
Phil
Short answer: no. Long answer: we looking forward to provide similar (or even better :) ) functionality.
-- Best regards, Igor Stasenko.
participants (5)
-
Camillo Bruni -
Eliot Miranda -
Igor Stasenko -
phil@highoctane.be -
Sean P. DeNigris