Behaviors and scripts and a new handler structure...
Mark Smith
marksmithhfx at gmail.com
Sun Apr 4 16:30:22 EDT 2021
Hi Bob,
If you have a bit of time, could you tell us a bit more about how?
Thanks,
Mark
> On Apr 2, 2021, at 12:42 AM, Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
>
> I have already implemented this with the help of others, for Datagrids. I think it works already for other things.
>
> Bob S
>
>
>> On Apr 1, 2021, at 12:51 , Paul Dupuis via use-livecode <use-livecode at lists.runrev.com> wrote:
>>
>> I have increasingly been using behaviors in my applications where it makes sense to assign a script to multiple objects or to override the actions of existing script handlers by assign a behavior with different version of those handlers.
>>
>> The one thing I dislike about behaviors is all the objects I need to create (a button for this behavior another button for that behavior script and so on).
>>
>> I'd love to see a new LCS structure like the following:
>>
>> behavior <behaviorName>
>>
>> <series of one or more handlers>
>>
>> end <behaviorName>
>>
>> that you can just have in a script. Even multiple behaviors in the same script perhaps each with their own 'mouseUp' handlers and then you can set the behavior of an object to a behavior name and done. Obviously, any messages (i.e mouseDown, mouseUp, etc. etc.) in the behavior block should never received a mouseDown, mouseUp, etc. message unless sent to the object tat have the behavior assigned to it.
>>
>> I think it would make code maintenance potentially much easier. I don't have any idea how much of a engine change such a addition to the language would represent.
>>
>> Anyone else think this is a good idea?
>
>
> _______________________________________________
> 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