Sending mouseUp

Paul Hibbert lc at pbh.on-rev.com
Wed Mar 20 17:27:00 EDT 2013


Craig,

I changed the button scripts to put their names into a global variable and the stack script to answer the global at the end of the openCard handler, the answer was in exactly the same order, nothing missing.

Paul


On 2013-03-20, at 2:14 PM, dunbarx at aol.com wrote:

> Paul.
> 
> 
> I wonder if the "answer" command has thrown a monkey wrench into the timing of these events. I assume you dismissed each of the dialogs as they appeared, but who know what evil lurked in the heart of LC when this sort of stuff appeared, and lingered, on screen. Can you do it again, loading the short names somewhere without any "answer" stuff?
> 
> 
> 
> Craig
> 
> 
> -----Original Message-----
> From: Paul Hibbert <lc at pbh.on-rev.com>
> To: How to use LiveCode <use-livecode at lists.runrev.com>
> Sent: Wed, Mar 20, 2013 5:06 pm
> Subject: Re: Sending mouseUp
> 
> 
> Out of curiosity I created a simple stack with one card and four buttons named 
> "Button 1" though "Button 4", each button just had the script;
> 
> on mouseUp
>   answer the short name of me
> end mouseUp
> 
> then I put the following in the stack script;
> 
> on preOpenStack
>   testMessage1
> end preOpenStack
> 
> on openStack
>   testMessage2
> end openStack
> 
> on preOpenCard
>   testMessage3
> end preOpenCard
> 
> on openCard
>   testMessage4
> end openCard
> 
> on testMessage1
>   send "mouseUp" to btn 1
> end testMessage1
> 
> on testMessage2
>   send "mouseUp" to btn 2
> end testMessage2
> 
> on testMessage3
>   send "mouseUp" to btn 3
> end testMessage3
> 
> on testMessage4
>   send "mouseUp" to btn 4
> end testMessage4
> 
> After building the app and launching it I received the following 4 answers;
> 
> Button 1
> Button 3
> Button 2
> Button 4
> 
> Answers to Buttons 1 & 3 appeared before the card was visible, answers to 
> Buttons 2 & 4 appeared after the card appeared.
> 
> Tried with the preOpenCard & openCard handlers on the card script too, with 
> exactly the same result.
> 
> Maybe this is over simplifying things a little, but it shows that messages are 
> sent from preOpenStack/Card and received by the buttons, so I would imagine 
> there is something else at the heart of the issue in this case.
> 
> Paul
> 
> On 2013-03-20, at 2:00 PM, Peter Haworth wrote:
> 
>> Hi Craig,
>> You're right that the button wasn't fully qualified initially, but no error
>> was thrown.  That's another problem I've come across in preOpenCard - often
>> errors just don't get thrown.  Plus red dot break points don't trigger
>> (although a breakpoint command does).
>> 
>> All in all, preOpenCard is a weird and strange environment.  I plan to
>> avoid it wherever possible in the future.  In the project with the current
>> issue, preOpenCard consist of a "hide stack" command and I've moved all my
>> processing to openCard with a "show stack" command at the front (thanks to
>> Geoff Canyon for that technique).  I hate to have to resort to that type of
>> trickery but I've spent way too much time debugging preOpenCard issues in
>> the past.
>> 
>> 
>> On Wed, Mar 20, 2013 at 1:33 PM, <dunbarx at aol.com> wrote:
>> 
>>> As I understand from Peter's original post, he did not send the message to
>>> an explicitly identified button, which I assume would indeed have thrown an
>>> error. Or at least it should have.
>> 
>> 
>> 
>> 
>> Pete
>> lcSQL Software <http://www.lcsql.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
> 
> 
> _______________________________________________
> 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
> 
> 
> _______________________________________________
> 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





More information about the use-livecode mailing list