send mouseup to control
ahsoftware at sonic.net
Wed May 24 19:31:13 CEST 2017
On 05/24/2017 10:21 AM, Alejandro Tejada via use-livecode wrote:
> Hi All,
> Reading LiveCode Dictionary about the target and send,
> could not find an obvious way to get the name of a message
> sender without putting first this name in another container
> (a custom property, a field or a global variable).
> Why do I need to know which control send a message
> to another control?
> Because the handler in the control executes different code
> depending of which control sends it a mouseup handler.
> For now, I am using a mouseup button parameter that
> could be 1 or 2 or 3. If the control receive a mouseup with
> parameter 1, then executes handler 1. If the mouseup is
> received with a parameter 2 then control executes
> handler 2.
> Which other ways could I use to produce the same result?
You could pull the information out of the executionContexts, but you'd
probably be better off with a bit of refactoring. Instead of sending a
mouseUp message, I'd send the handler 1 or handler 2 message directly.
ahsoftware at gmail.com
More information about the use-livecode