How can I append a link to a text in a text morph?
I am trying without success:
| t m | m := TextMorphPlus new openInWorld. t := Text string: 'hello ' attribute: (TextColor red). t append: (Text string: ' TOTO' attribute: (TextLink scanFrom: (ReadStream on: 'LMorph new;'))).
But really I don't understand the way to use TextLink
Hilaire
Hilaire Fernandes a écrit :
How can I append a link to a text in a text morph?
I am trying without success:
| t m | m := TextMorphPlus new openInWorld. t := Text string: 'hello ' attribute: (TextColor red). t append: (Text string: ' TOTO' attribute: (TextLink scanFrom: (ReadStream on: 'LMorph new;'))).
and I forgot the last line
m contents: (t).
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Responding to myself as it may be useful to other. I was mislead by the TextLink class name. PluggableTextAttribute is the one to use.
| t m | m := TextMorph new openInWorld. t := Text string: 'hello ' attribute: TextColor red. t append: (Text string: 'click ici' attribute: (PluggableTextAttribute evalBlock: [Morph new openInWorld])). m contents: t
Hilaire Fernandes a écrit :
Hilaire Fernandes a écrit :
How can I append a link to a text in a text morph?
I am trying without success:
| t m | m := TextMorphPlus new openInWorld. t := Text string: 'hello ' attribute: (TextColor red). t append: (Text string: ' TOTO' attribute: (TextLink scanFrom: (ReadStream on: 'LMorph new;'))).
and I forgot the last line
m contents: (t).
beginners@lists.squeakfoundation.org