TextMorph events

Bijan Parsia bparsia at email.unc.edu
Sat Feb 2 06:07:35 UTC 2002


On Sat, 2 Feb 2002, Gary McGovern wrote:

> I'm not sure what you mean there. To explain a bit better what I need:
> 
> I don't want to alter or edit the text. 

The standard way of creating a hyperlink is to add a certain kind of style
to the text via command-6. Check out TextAction and friends.

If you want the TextMorph itself to be a button, er..., use a button :)

> When I click on the text I
> want to go to another page in a bookmorph, or other text in a
> bookmorph, or open a window or other morph, " rather than the I beam
> sitting in the textmorph for editing.

If you select *all* the text in a text morph, and do the "link" think,
you'll get pretty close to this behavior, I think. Otherwise, you could
always cover your morph with a transparent button, maybe, a la hypercard?

[snip]
John Hinsley wrote:
> >You can make other kinds of active links this way, including links to 
> >classes, methods, or URL's."
> >
> >But while this works for most text_in_morphs, I don't think it'll work
> >for a plain old text morph.

The morph itself or the "text" in a "plain ole text morph"?

> > I could never come up with a satisfactory
> >explanation of why!
[snip]

Hmm. What's not working? The technique? The cmd-6 thing is a *UI*
issue. If your textmorph isn't hooked up to the right editor, you can't
use it.

OTOH, you can certainly add styles to *any* Text, including to the
plainest of the TextMoprhs...you just have to do it programmatically. I
show how to do this in on of the SqueakTweak columns. Check out the
TextEmphasis hierarchy, and Text itself.

Those links aren't restricted to Morphic, BTW.

Cheers,
Bijan Parsia.




More information about the Squeak-dev mailing list