trevordevore / levure

Application development framework for LiveCode
MIT License
32 stars 14 forks source link

differentiate between behaviors and libraries #152

Closed macMikey closed 4 years ago

macMikey commented 4 years ago

more explanation of the difference between behaviors and libraries, would be good. The only thing that comes to mind is chaining of behaviors, but it is not clear that you can only do that with behaviors and not with libraries.

trevordevore commented 4 years ago

Hi @macMikey. Isn’t that a LiveCode docs question? Levure is just loading libraries using ‘start using’ and behaviors are loaded into memory before anything else. The difference as far as the engine is concerned should be in the LiveCode docs.

macMikey commented 4 years ago

I'm asking in the context of a Levure project. It's the subtlety that is not captured in the wiki. You have a libraries folder and a behaviors folder (forgetting ui behaviors, for a moment). Why would someone put an SOS in one vs. the other? If the difference is "you can chain behaviors using LoadBehavior, then I guess that's an answer, but is there any reason that LoadBehavior can't be used with libraries? Are libraries imagined to be standalone thangers?

trevordevore commented 4 years ago

Hmm, it sounds like you may not be familiar with the term “library” in the LiveCode sense as behaviors and libraries have different purposes. Library handlers are global and behaviors are local to the object they are assigned to.

Like the docs say for Libraries, all stacks in the folder will be loaded using ‘start using’.

See this article on libraries: http://livecode.byu.edu/messages/libraries.php

macMikey commented 4 years ago

This isn't for me. I just noticed that I can edit the wiki, so I'll just have at it.