send mouseup to control
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
send mouseup to control
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?
Al
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?
Al
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: send mouseup to control
Click on all 3 buttons and the picture to see what messages you get
-
- VIP Livecode Opensource Backer
- Posts: 9802
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: send mouseup to control
The executionContexts is a good way to get any part of the calling chain. For the item in question, try:
Code: Select all
function CallerID
-- Line -1 = this function
-- Line -2 = the script that called this function
-- so:
return item 1 of line -3 of the executionContexts
end CallerID
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 7215
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: send mouseup to control
I generally just use "the name of the target" or "the short name of the target", depending on whether I need the object identifier included.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9802
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: send mouseup to control
Doesn't the target change with "send"?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 7215
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: send mouseup to control
Yes, I missed that part. I read the OP as considering the two terms separately rather than in tandem.FourthWorld wrote:Doesn't the target change with "send"?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com