Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
I have a button on card A which when clicked should use the send command to send a mouseUp event to a button on card B. I've done this by issuing the send command followed by a go command.
If card B is already open, this works fine. If card B has not yet been opened in the current run of the application, it doesn't open. If card B has been opened at least once during the current run but then closed again, this works.
send "mouseUp mySQL" to button "triggerFilterButton" of card "DB_Places" of stack "Places"
go stack "Places"
I've also tied using the go command to a the card within the stack (there'sonly one crd in the stack). I've tried issuing the go command before the send command - same problem
send "mouseUp" to button "triggerFilterButton" of card "DB_Places" of stack "Places"
go stack "Places"
without having MySQL behind 'mouseUp'
I have just created a stack which has two cards named, 'A' and 'B'... On each card there is a button named 'A' and 'B' respectively. In the script of button 'A' on card 'A', I placed
on mouseUp
put "This is a message from button B on card B"
end mouseUp
Rev goes to card 'B' and the response appears in the message box every time... it does not matter if it is run on opening the stack or if the stack has been opened and the cards have been visited...
Thanks for the suggestion. I tried it without passing the mySQL parameter but still getting the same problem. Useful to try but it turns out I have to pass in the mySQL parameter for the logic of my app to work, unless I can find another way to hand mySQL off to the button in question.
on mouseUp
put "this is a test" into tParameter
send triggerMyFilter && tParameter to btn "triggerFilterButton" of card 1 of stack "Places"
end mouseUp
Probably your button "triggerFilterButton" has a routine to work on mySQL, you could break that out in the button to let the "triggerMyFilter" handle it. The tMySQL would be passed from the mouseUp handler along with the command.
or you could use a global variable to make mySQL accessible to your receiving button, but I don't like global variables, it is easy to loose track of what handler fills them and when.
regards
Bernd
Thanks Bernd. I've been working on this today and have put what used to be in the mySQL variable into a custom property of the target of the send command. That all works well but I still have the same issue with the from not opening.
If it sheds any further light on this, when I do this in the standalone app version of my application, I get the error dialog box and the details supplied in the Email option are:
Executing at 10:48:08 AM on Sunday, February 7, 2010
Type: Handler: error in statement
Object: group 'PlacesGrid' of group 'DB_Places' of card 'DB_Places' of stack 'Places' of stack '/Applications/BandTrak/BandTrak.app/Contents/MacOS/BandTrak'
Line:
Line Num: 0
Hint: -8
One thing I would like to do is somehow trace all the vents that occur after I click on the original button that sets this whole process in motion. Is there a way to trace events in the debug tool?
Pete,
in the IDE you can use the Message Watcher in the Development Menu. It lists, well, the messages.
I don't know if this helps.
@ Klaus, good to know, I thought it was always the the mouseButtonNumber that were passed to mouseUp
regards
Bernd
Thanks for all the advice, I think I've fixed the problem now. There was some code that was being executed in the openCard handler of "card B" that I think was causing problems with the execution of the code I was sending the mouseUp message to. I still don;t fully understand exactly what was going on but after fixing that issue, all seems to be working well now.
Pete
phaworth wrote:
One thing I would like to do is somehow trace all the vents that occur after I click on the original button that sets this whole process in motion. Is there a way to trace events in the debug tool?
If you're using glx2 then you should have that info available. The IDE's error reporting is fairly terse about this. But if you want to handle the errorDialog message yourself then you can print out the executionContexts, which will give you the call stack, both in the IDE and in a standalone.