[squeak-dev] Morph wants to know when it loses focus

tim Rowledge tim at rowledge.org
Tue Feb 11 23:48:02 UTC 2014


On 11-02-2014, at 1:51 PM, Bert Freudenberg <bert at freudenbergs.de> wrote:

> 
> On 11.02.2014, at 22:21, tim Rowledge <tim at rowledge.org> wrote:
> 
>> 
>> On 11-02-2014, at 12:50 PM, Bert Freudenberg <bert at freudenbergs.de> wrote:
>> 
>>> On 11.02.2014, at 21:28, tim Rowledge <tim at rowledge.org> wrote:
>>> 
>>>> I must be missing something obvious but searching around focus and lose and so on hasn’t revealed anything to me so far; I want to know when my Morph has lost mouse focus. I need something like when a halo goes away if you click outside it. I know this is going to reveal an embarrassing inability to read something right on front of me but at some point you just have to ask where your spectacles are even if they usually turn out to be on your head.
>>> 
>>> Your morph should be sent keyboardFocusChange: false when it loses focus.
>> 
>> Unfortunately that is only for something that got keyboard focus. I thought that newMouseFocus: ought to be it but despite comments claiming to release the mouse focus it only seems to be internal to the HandMorph; nothing seems to go to the old focus morph.
> 
> Yep.

Does anyone have any thoughts on why this doesn’t happen? Was it simply forgotten about, or found to be problematical and so removed? Seems like a useful thing to happen to me; but I’m not expert in Morphic.

As a work-around for now I’m over-riding #rejectsEvent: to test for a mouse down outside my bounds and killing the morph that way. Oh, and returning true since it seems likely a non-existent morph means its ghost rejects any events...

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: BFM: Branch on Full Moon




More information about the Squeak-dev mailing list