finding the name of the target's stack in a script
Peter M. Brigham
pmbrig at gmail.com
Tue Jul 24 14:33:53 EDT 2012
On Jul 24, 2012, at 12:22 PM, Ben Rubinstein wrote:
> On 24.07.2012, at 17:33, Dr. Hawkins wrote:
> > I have a handler that needs to handle an event differently depending
> > upon which substack the button calling it is on.
>
> You could use "the owner" to walk up the heirarchy from the target - eg create a function "owningStack" which successively gets the owner of its parameter (originally the target) until it gets a stack?
Here's a ndler I use to get the highest background of a control:
function masterBG theObject
put the long id of the owner of theObject into onr
if word 1 of onr = "card" then
return theObject
else
return masterBG(onr)
end if
end masterBG
You could modify this…
-- Peter
Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig
More information about the use-livecode
mailing list