All:

So here is another test. Make a brand new stack. Put this into the stack script:


on mouseUp
   dispatch "mouseUp" to this card
   answer it
end mouseUp


If you start with a new session, opening the test stack from the finder, you 
will get an error:



Type    Handler: can't find handler
Object  Untitled 2
Line    send "mouseUp" to this card
Hint    mouseUp



There is no such card (yet); the card just does not exist. However, also in a 
new session, if you open another stack, and then open the test stack from the 
finder, all is well.  So "preOpenCard" is invoked REALLY early, but it seems to 
matter when and how it is invoked as well.


Craig








-----Original Message-----
From: Peter Haworth <p...@lcsql.com>
To: How to use LiveCode <use-livecode@lists.runrev.com>
Sent: Wed, Mar 20, 2013 3:09 pm
Subject: Re: Sending mouseUp


Thanks Geoff.  I had thought about moving things into openCard.  I already
found I had to move some code that used libURLxxx from preOpenCard to
openCard because of the library not being loaded.  Didn't think of the
visible part of it though, thanks for the idea.

Pete
lcSQL Software <http://www.lcsql.com>


On Wed, Mar 20, 2013 at 11:55 AM, Geoff Canyon <gcan...@gmail.com> wrote:

> I set the visible of a stack to false, and put this in the stack script:
>
> on opencard
>    send "set the visible of me to true" to me in 5 seconds
> end opencard
>
> I didn't try it in a standalone, but opening that in the dev environment
> resulted in no visible change for 5 seconds, then the stack appeared. So
> you could do something like this and run your code after the stack has
> fully loaded (but is still not visible).
>
>
> On Wed, Mar 20, 2013 at 1:43 PM, Mike Bonner <bonnm...@gmail.com> wrote:
>
> > Oh duh. So even if its a send in time, and the control DOES exist by the
> > time the send kicks in, the underlying stuff doesn't get set right when
> the
> > send is queued so it doesn't work?  That actually makes sense.
> >
> > Think I'm going to start changing how I structure things from now on.
> >
> >
> > On Wed, Mar 20, 2013 at 12:21 PM, Mark Wieder <mwie...@ahsoftware.net
> > >wrote:
> >
> > > Peter Haworth <pete@...> writes:
> > >
> > > > I guess I'm just very suspicious of anything other than really
> > > > straightforward commands in preOpenCard now.
> > >
> > > Well, here's the thing. It's *pre*OpenCard because the card and its
> > > controls
> > > haven't been instantiated yet. So sending a message to a control that
> > > doesn't
> > > officially exist shouldn't work. The script is there in memory, so you
> > can
> > > call
> > > handlers in it, but it's not yet associated with an on-screen object.
> The
> > > pre
> > > handlers exist so that you can set things up before the objects take
> > form.
> > >
> > > --
> > >  Mark Wieder
> > >  mwie...@ahsoftware.net
> > >
> > >
> > > _______________________________________________
> > > use-livecode mailing list
> > > use-livecode@lists.runrev.com
> > > Please visit this url to subscribe, unsubscribe and manage your
> > > subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-livecode
> > >
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

 

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to