focusIn

Kay C Lan lan.kc.macmail at gmail.com
Wed Mar 25 10:30:04 EDT 2015


LC 7.0.3
New stack, two new fields with their lockText set to true.
In both fields their scripts:

on focusIn
   set the backgroundColor of me to green
end focusIn

on focusOut
   set the backgroundColor of me to red
end focusOut

Pressing the Tab key moves the focus from one to the other and the
backgroundColor changes from green to red and vice versa.
If I change the lockText to false in both fields, then change the script to:

on openField
   set the backgroundColor of me to green
end openField

on ExitField
   set the backgroundColor of me to red
end ExitField

Again the backgroundColor changes from red to green and vice versa when I
tab.

So you are right. There is no difference.

PS If you need the same to happen when data in the field is changed then
you'd also have to include an CloseField handler.

On Wed, Mar 25, 2015 at 3:17 PM, Richmond <richmondmathewson at gmail.com>
wrote:

> On 25/03/15 09:14, John Dixon wrote:
>
>> Richmond...
>>
>> from the dictionary... 'If the control is an unlocked field .....  the
>> openField message is sent to it instead of the focusIn message.'
>>
>> Is your field unlocked ?...:-)
>>
> Cannot see any difference really.
>
>
>
>>
>>  Date: Wed, 25 Mar 2015 08:57:47 +0200
>>> From: richmondmathewson at gmail.com
>>> To: use-livecode at lists.runrev.com
>>> Subject: focusIn
>>>
>>> I tried this:
>>>
>>> on focusIn
>>>      set the backGroundColor of fld "CHAMP" to green
>>> end focusIn
>>>
>>> and it didn't work.
>>>
>>> I wanted to change a field's backGroundColor when someone selects that
>>> field;
>>> obviously THAT method doesn't work.
>>>
>>> Richmond.
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list