logo       

Re: Text with Link: msg#00029

lang.smalltalk.squeak.beginners

Subject: Re: Text with Link

-----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).

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHWR7iSAvrR6lz6PQRAqIMAKC1KtyqhDKCgi+YKJWQUuvEpEXfxACfZn0L
RFlPX7ACXObMQCBFJeVOd+U=
=j0rZ
-----END PGP SIGNATURE-----


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise