Re: Behavior question

2015-07-23 Thread J. Landman Gay
I never would have thought of that. What a handy tip. On 7/22/2015 5:32 PM, Peter Haworth wrote: Put a reference to the behavior stack in the stackFiles property of my application stack and commented out the startup handler. It works! On Wed, Jul 22, 2015 at 12:39 PM Peter Haworth

Re: Behavior question

2015-07-22 Thread J. Landman Gay
You double-checked the path to the behavior, right? If there are any other handlers in the behavior, do those work? On 7/22/2015 12:48 AM, Peter Haworth wrote: Right, the unhandled is what is throwing me, plus the fact that using send results in a runtime error. As I've found, what I'm doing

Re: Behavior question

2015-07-22 Thread J. Landman Gay
Is this one of the behaviors that's dynamically assigned at startup or when a stack opens? I wonder if it's assigned too soon, before everything has finished loading. On 7/22/2015 1:03 PM, Peter Haworth wrote: Yep, checked it over and over, plus the spelling of the command. My lcStackbrowser

Re: Behavior question

2015-07-22 Thread Peter Haworth
Yep, checked it over and over, plus the spelling of the command. My lcStackbrowser plugin has a feature where you click on an icon for an object's behavior and it automatically opens its script - that opens the correct script so pretty sure all is OK. I tried dispatching to a different handler -

Re: Behavior question

2015-07-22 Thread Richard Gaskin
Peter Haworth wrote: I do recall someone (Richard Gaskin) entering an enhancement request for a command to reestablish behaviors. My handler is very fast, not even noticeable at startup but it would be nice to have an official way to do it. Mark Waddingham's comment #8 here suggests a good

Re: Behavior question

2015-07-22 Thread Peter Haworth
Thanks Richard. Read Mark's comment and I agree his solution sounds like the best way forward. On Wed, Jul 22, 2015 at 12:05 PM Richard Gaskin ambassa...@fourthworld.com wrote: Peter Haworth wrote: I do recall someone (Richard Gaskin) entering an enhancement request for a command to

Re: Behavior question

2015-07-22 Thread Peter Haworth
Well now it's one of the ones that is assigned at startup - it wasn't when I started this thread. I'm pretty sure this all has to do with the engine's resolution of behavior references happening before all stacks are loaded. I have all my behaviors in a separate mainstack which is opened in a

Re: Behavior question

2015-07-22 Thread Peter Haworth
This now ringing a bell with a problem I had a few months ago where many behaviors were not being resolved. In that thread, somebody recommended a repeat loop at startup to go through all objects in the stack, find the ones with behaviors and set the behavior to its existing property. That fixed

Re: Behavior question

2015-07-22 Thread Mark Wieder
On 07/22/2015 12:39 PM, Peter Haworth wrote: Well now it's one of the ones that is assigned at startup - it wasn't when I started this thread. I'm pretty sure this all has to do with the engine's resolution of behavior references happening before all stacks are loaded. I have all my behaviors

Re: Behavior question

2015-07-22 Thread Peter Haworth
Put a reference to the behavior stack in the stackFiles property of my application stack and commented out the startup handler. It works! On Wed, Jul 22, 2015 at 12:39 PM Peter Haworth p...@lcsql.com wrote: Well now it's one of the ones that is assigned at startup - it wasn't when I started

Re: Behavior question

2015-07-21 Thread Mark Wieder
On 07/21/2015 04:55 PM, Peter Haworth wrote: I just tried a very simple test in another stack and it worked so there must be something in the stack with the problem that is preventing the behavior from being resolved. Well, it *should* work. In most cases anyway. The only thing I can think

Re: Behavior question

2015-07-21 Thread Peter Haworth
Yes, of course behavior is a property but the control referred to in the behavior has a script and the loadData handler is in that script. Hope that clarifies things On Tue, Jul 21, 2015 at 8:44 PM Mark Wieder mwie...@ahsoftware.net wrote: On 07/21/2015 04:55 PM, Peter Haworth wrote: I just

Re: Behavior question

2015-07-21 Thread Peter Haworth
Right, the unhandled is what is throwing me, plus the fact that using send results in a runtime error. As I've found, what I'm doing works in a simplified environment so for some reason, this particular behavior isn't being resolved, just can't figure out why. On Tue, Jul 21, 2015 at 8:44 PM

Behavior question

2015-07-21 Thread Peter Haworth
I have a button named myButton with a behavior myBehavior whose script includes a handler named loadData. From anther control I execute: dispatch loadData to button myButton The loadData handler is not executed and the it variable contains unhandled after the dispatch command. That should

Re: Behavior question

2015-07-21 Thread J. Landman Gay
On 7/21/2015 4:02 PM, Peter Haworth wrote: I have a button named myButton with a behavior myBehavior whose script includes a handler named loadData. From anther control I execute: dispatch loadData to button myButton The loadData handler is not executed and the it variable contains

Re: Behavior question

2015-07-21 Thread Peter Haworth
Thanks Jacque, that might have yielded a clue. When I use send, I get a runtime error can't find handler. I've had issues in the past with behavior references not being resolved, to the extent that I wrote a handler to re-establish all object behavior references when my stack opens. Maybe this

Re: Behavior question

2015-07-21 Thread Peter Haworth
It's a command. Even checked the spelling and also copy/pasted the handler name from it's declaration into the dispatch command. On Tue, Jul 21, 2015 at 3:33 PM Richard Gaskin ambassa...@fourthworld.com wrote: Is loadData defined as a command or a function? -- Richard Gaskin Fourth

Re: Behavior question

2015-07-21 Thread dunbarx
: Behavior question I have a button named myButton with a behavior myBehavior whose script includes a handler named loadData. From anther control I execute: dispatch loadData to button myButton The loadData handler is not executed and the it variable contains unhandled after the dispatch command

Re: Behavior question

2015-07-21 Thread Richard Gaskin
Is loadData defined as a command or a function? -- Richard Gaskin Fourth World Systems Software Design and Development for the Desktop, Mobile, and the Web ambassa...@fourthworld.com

Re: Behavior question

2015-07-21 Thread Peter Haworth
-Original Message- From: Peter Haworth p...@lcsql.com To: How to use LiveCode use-livecode@lists.runrev.com Sent: Tue, Jul 21, 2015 5:05 pm Subject: Behavior question I have a button named myButton with a behavior myBehavior whose script includes a handler named loadData. From anther

Re: Behavior question

2015-07-21 Thread dunbarx
, Jul 21, 2015 6:54 pm Subject: Re: Behavior question It's a command. Even checked the spelling and also copy/pasted the handler name from it's declaration into the dispatch command. On Tue, Jul 21, 2015 at 3:33 PM Richard Gaskin ambassa...@fourthworld.com wrote: Is loadData defined

Re: Behavior question

2015-07-21 Thread Peter Haworth
I just tried a very simple test in another stack and it worked so there must be something in the stack with the problem that is preventing the behavior from being resolved. On Tue, Jul 21, 2015 at 3:53 PM Peter Haworth p...@lcsql.com wrote: It's a command. Even checked the spelling and also