Stack Files and Behaviors
Trevor DeVore
lists at mangomultimedia.com
Tue Jun 13 15:46:31 EDT 2017
On Tue, Jun 13, 2017 at 12:43 PM, Sannyasin Brahmanathaswami via
use-livecode <use-livecode at lists.runrev.com> wrote:
>
> 3) By default, all the behaviors were added at the beginning of this
project, but, a recent "event" tells me that you *do not* need to add
behaviors to the stack files.
>
> Assuming a behavior is saved and open in memory at the time you assign
the behavior_*some*.livecodescript to someControl X
>
> then the behavior *will* be opened even if not in the stackfiles
>
> Of course I can test this with a unit test separate from our big
framework, but can anyone confirm?
This is incorrect. Assigning a stack as a behavior doesn’t not allow the
engine to automatically find it. The behavior property only contains the
stack name, not the path to the stack on disk. You need to add the stack
being used as the behavior to the stackfiles property.
I store the behavior stack in a folder that sits alongside the binary stack
with the UI. You can use a relative path that points to the behavior and
then you don’t have to worry about adding anything to the general json
file. The Levure docs explain my approach:
https://github.com/trevordevore/levure/wiki/ui
At the bottom of the page is a link to a video that shows how to use the
Property Inspector in LC 8.1.5 and above to easily add script only stack
behaviors. RC-1 is now available.
- -
Trevor DeVore
ScreenSteps
More information about the use-livecode
mailing list