how to make it apparent that a TextMorph's text (or substring thereof) has been selected?

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

how to make it apparent that a TextMorph's text (or substring thereof) has been selected?

Alexandre Rousseau
Hi

I am working with a descendant of TextMorph.

The following code does what I want except for one thing: make it apparent that there is a selection, i.e., no selection highlight is visible.
 
mouseEnter: evt
self takeKeyboardFocus.
self editor selectAll.

Can someone point me in the right direction?

Thanks in advance
Alex




Reply | Threaded
Open this post in threaded view
|

RE: how to make it apparent that a TextMorph's text (or substringthereof) has been selected?

Gary Chambers-4
You'll need to implement

handlesMouseOver: anEvent
 "Answer true if we want to receive mouseEnter and mouse Leave events."

 ^true
 
and update your mouse enter code with

mouseEnter: evt
        self takeKeyboardFocus.
        self editor selectAll.
        self changed

Reply | Threaded
Open this post in threaded view
|

Re: how to make it apparent that a TextMorph's text (or substringthereof) has been selected?

Alexandre Rousseau
Thanks. That did it.

Cheers
Alex


On 13-Nov-07, at 6:49 PM, Gary Chambers wrote:

> You'll need to implement
>
> handlesMouseOver: anEvent
>  "Answer true if we want to receive mouseEnter and mouse Leave  
> events."
>
>  ^true
>
> and update your mouse enter code with
>
> mouseEnter: evt
> self takeKeyboardFocus.
> self editor selectAll.
> self changed
>