Do script-only stacks support "chained" behaviors?

Ali Lloyd ali.lloyd at livecode.com
Sat Jan 20 20:18:17 EST 2018


I should clarify: say you want stack 1 to have behavior stack 2 which has
behavior stack 3.

In the IDE we commonly do:
Stack 1:

on preOpenStack
   dispatch "setAsBehavior" to stack "Stack 2" with the long id of me
end preOpenStack

Stack 2:
on setAsBehavior pTarget
   dispatch "setAsBehavior" to stack "Stack 3" with the long id of this me
   set the behavior of pTarget to the long id of this me
end setAsBehavior

Stack 3:
on setAsBehavior pTarget
   set the behavior of pTarget to the long id of this me
end setAsBehavior

On Sun, Jan 21, 2018 at 1:12 AM Ali Lloyd <ali.lloyd at livecode.com> wrote:

> There are also plenty of examples in the IDE - most of the palettes have
> their own specific behavior chained to the generic palette behavior.
>
> Most of them do something like the following handler:
> on setAsBehavior pTarget dispatch "setAsBehavior" to stack
> revIDEFrameBehavior() with the long id of this me set the behavior of
> pTarget to the long id of this me end setAsBehavior
>
> They then call the setAsBehavior handler on preOpenStack.
>
> On Sun, Jan 21, 2018 at 12:14 AM Trevor DeVore via use-livecode <
> use-livecode at lists.runrev.com> wrote:
>
>> On Sat, Jan 20, 2018 at 5:53 PM Mike Kerner via use-livecode <
>> use-livecode at lists.runrev.com> wrote:
>>
>> > I believe they do, because I think Trevor is doing this with Levure.
>>
>>
>> You can’t specify the behavior property of a script only stack in the
>> script only stack itself. You have to assign the behavior of the script
>> only stack using code after the stack has been loaded into memory. The
>> behavior property setting won’t persist however.
>>
>> Trevor DeVore
>> ScreenSteps
>>
>> >
>> _______________________________________________
>> 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