<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, 14 Sep 2018 at 22:56, Christian Kellermann <<a href="mailto:ckeen@pestilenz.org">ckeen@pestilenz.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi List!<br>
<br>
I want to program a gopher client in squeak and I am a bit stuck<br>
on how to do the rendering.  I got the hint that I could use a<br>
TextMorph since there links are a text attribute.<br>
<br>
However I am a bit clueless on how this is supposed to fit together.<br>
<br>
What I did atm was that for gopher menus I have an OrderedCollection of MenuItems.<br>
Those in turn have implemented their #asText methods. For links I<br>
am returning TextURL objects there.<br>
<br>
This is all collected in a GopherPage's #asText method where said<br>
orderedCollection is #join'ed together.<br>
<br>
As it turns out though, the TextMorph will render my URL as if the<br>
#printOn: message has been sent to it.  TextURLs will show up in<br>
the TextMorph as 'a TextURL'. My guess is that the #join is responsible<br>
for this.<br>
<br>
How am I supposed to add URLs into Text?<br></blockquote><div><br></div><div>Here is something I recently did in Pharo.  I expect these parts of the systems are very similar.</div><div><br></div><div><div>url := '<a href="https://google.com">https://google.com</a>'.</div><div>linkText := url asText</div><div><span style="white-space:pre">             </span>addAttribute: (TextAction new actOnClickBlock: [ExternalWebBrowser new open: url]);</div><div><span style="white-space:pre">           </span>addAttribute: TextColor blue;</div><div><span style="white-space:pre">         </span>addAttribute: TextEmphasis underlined.</div><div>tm := TextMorph new.</div><div>tm contents:  linkText.</div><div>tm openInWindow</div></div><div><br></div><div>You'll need to find an appropriate "ExternalWebBrowser" library for your Squeak version.   <br></div><div><br></div><div>cheers -ben</div></div></div></div></div></div></div></div>