Text with Link

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Text with Link

Hilaire Fernandes-4
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

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Text with Link

Hilaire Fernandes-4
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 mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Text with Link

Hilaire Fernandes-4
-----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-----

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners