dispatch and the target

Pete pete at mollysrevenge.com
Fri Aug 12 15:12:39 EDT 2011

Update on this.  If the calling stack is a palette, the topstack refers to
one of the IDE's stacks (applicationoverview.rev I think), and the
defaultstack refers to the library stack not the palette stack.  In
addition, the executionContexts contains no reference to the palette stack.

I'm pretty much giving up hope that there is a safe way to get hold of the
calling stack.  I was hoping that a combination of "start using" and a
libraryStack handler in the library stack would do what I need but doesn't
look like that will work.  Not a big deal, just needs one extra line of code
in the calling stack to call my initialisation routine.

Molly's Revenge <http://www.mollysrevenge.com>

On Fri, Aug 12, 2011 at 11:38 AM, Pete <pete at mollysrevenge.com> wrote:

> Thanks for the additional info.  "start using" works in my situation as the
> scripts are all in the stack it refers to although I probably did that
> because it was a requirement for "start using".  In any case, it all seems
> to work as expected.
> I will have to experiment more with situations where the calling stack is
> not toplevel.  Maybe I'll have to go back to parsing the executionContexts.
> Pete
> Molly's Revenge <http://www.mollysrevenge.com>
> On Fri, Aug 12, 2011 at 11:04 AM, J. Landman Gay <jacque at hyperactivesw.com
> > wrote:
>> On 8/12/11 12:04 PM, Bob Sneidar wrote:
>>> You can refer to the current stack using the topStack.
>> Yes, but with caveats. If the stack isn't a toplevel (regular document)
>> stack, then it (usually) won't be the topstack. It might be the defaultstack
>> though.
>>  A library
>>> should be capable of working no matter which stack has the focus. I
>>> would rewrite  the scripts in the library stack to be independent.
>>> Also, you should not have to dispatch to a library stack. Start Using
>>> puts the stack script in the backScript, and therefore in the message
>>> path.
>>> This means however, that all your scripts need to be in the stack
>>> script and not other objects.
>> That's true, "start using" only works with stack scripts. You can use the
>> script of any object by doing "insert script of <object reference> into
>> back". That gives more flexibility and allows the in-use script to be stored
>> anywhere.
>> --
>> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
>> HyperActive Software           |     http://www.hyperactivesw.com
>> ______________________________**_________________
>> 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<http://lists.runrev.com/mailman/listinfo/use-livecode>

More information about the Use-livecode mailing list