FEATURE_INHERITED_PARENTSCRIPTS
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, LCMark
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: FEATURE_INHERITED_PARENTSCRIPTS
OK - I did a bit more experimenting and it's trickier than I thought. I hadn't thought of sending or calling directly into behavior scripts before rather than just inheriting the scripts. I confess I can't think of a problem that this solves, though. Now I'm coming around to Dar's request for a "caller" property that would unambiguously return a reference to the object that originated the request, whether it's a send/dispatch, call, or direct or inherited command invocation.
...and we still need an object syntax for the object the script is running in.
...and we still need an object syntax for the object the script is running in.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: FEATURE_INHERITED_PARENTSCRIPTS
There's no need to send or call directly into a behavior script to see the different...OK - I did a bit more experimenting and it's trickier than I thought. I hadn't thought of sending or calling directly into behavior scripts before rather than just inheriting the scripts. I confess I can't think of a problem that this solves, though. Now I'm coming around to Dar's request for a "caller" property that would unambiguously return a reference to the object that originated the request, whether it's a send/dispatch, call, or direct or inherited command invocation.
Code: Select all
group 1 -> behavior 1
button 1
button 2
Code: Select all
on mouseUp
foobar
end mouseUp
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: FEATURE_INHERITED_PARENTSCRIPTS
Good point. I forgot about group behaviors in this context.
...although "me" referencing a different object than the actual object containing the script sounds a bit like something out of Monty Python...
...although "me" referencing a different object than the actual object containing the script sounds a bit like something out of Monty Python...
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Re: FEATURE_INHERITED_PARENTSCRIPTS
I'm wondering if any more thought has been put into 'the scriptObject' idea discussed in this thread. I have a custom control that has some supporting controls on the same card as the behavior button. In order to use these supporting controls I need to get a reference to the behavior button. Having a reference (like 'the scriptObject') would be an elegant way to achieve this. Parsing the executionContexts is, well, less elegant.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: FEATURE_INHERITED_PARENTSCRIPTS
Well... we had a chat about syntax then lost the plot. I still like 'this behavior'... BTW recursively parsing the behavior property might be an option too.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Re: FEATURE_INHERITED_PARENTSCRIPTS
True. This would require some hard coding of names, however, wouldn't it? Since you have no way of knowing which behavior is the custom controls then you would have to check the name of each behavior control.BTW recursively parsing the behavior property might be an option too.
What about 'this me'?I still like 'this behavior'
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: FEATURE_INHERITED_PARENTSCRIPTS
I was thinking you would need to tag your behavior object in some way so you could identify it. Either a custom property value or just the name:True. This would require some hard coding of names, however, wouldn't it? Since you have no way of knowing which behavior is the custom controls then you would have to check the name of each behavior control.
Code: Select all
put findBehavior(the behavior of me,"com.bluemango.widget") into theScriptObject
Code: Select all
function findBehavior pObject,pClass
if the short name of pObject is pClass or pObject is empty then return pObject
return findBehavior(the behavior of pObject,pClass)
end
I'm soldWhat about 'this me'?
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Re: FEATURE_INHERITED_PARENTSCRIPTS
Ah, that method will work well enough until we get some sort of better reference.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: FEATURE_INHERITED_PARENTSCRIPTS
I think it was a case of - we might need this at some point, but since we couldn't decide on firm syntax it was left hanging.Well... we had a chat about syntax then lost the plot. I still like 'this behavior'... BTW recursively parsing the behavior property might be an option too.
It's easy to add - if we can decide on syntax
Re: FEATURE_INHERITED_PARENTSCRIPTS
We're settled on 'this me'
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: FEATURE_INHERITED_PARENTSCRIPTS
Seems as good as anything else that's been suggested so far - implemented and should be fine to go into 6.1.1 (feature-this_me branch in runrevmark).
Re: FEATURE_INHERITED_PARENTSCRIPTS
Lol... Serves us right for joking around Trevor
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: FEATURE_INHERITED_PARENTSCRIPTS
It's easy enough to change to 'this behavior' (or even 'this script'?) - it just means changing the 'skip_token()' line. I guess we can just wait and see what the reaction is to 'this me', and see if anybody comes up with a better suggestionLol... Serves us right for joking around Trevor
-
- VIP Livecode Opensource Backer
- Posts: 7214
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: FEATURE_INHERITED_PARENTSCRIPTS
HyperCard had a script error that said, "Script too silly to parse."
I kind of get that same reaction with "this me". Maybe it would make more sense in context.
I kind of get that same reaction with "this me". Maybe it would make more sense in context.
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: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: FEATURE_INHERITED_PARENTSCRIPTS
You want context?
If you google "this me" it suggests "this means war".
If you google "this me" it suggests "this means war".
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev