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

Bert Freudenberg bert at freudenbergs.de
Wed Feb 12 09:10:38 UTC 2014


On 12.02.2014, at 00:48, tim Rowledge <tim at rowledge.org> wrote:

> 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...

I guess the need doesn't arise often enough for it to have been added as a general feature. The only morph I'm aware of doing something similar would be a menu, which closes when you click outside. But that is sort-of modal so not exactly the same thing either. Or maybe it is?

- Bert -


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4142 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140212/b59ec6ac/smime.bin


More information about the Squeak-dev mailing list