interesting custom property behavior...

Ken Ray kray at sonsothunder.com
Mon Jul 4 09:03:54 EDT 2011



>> It turns out when you set a custom prop from within a LC custom property
>> inspector, it doesn't pass the setProp message. I'm sure this design is on
>> purpose, but I wonder why?
> 
> I believe the property inspector locks messages before setting
> properties. But that's just dragged from somewhere in my memory - I
> don't think it's documented and I couldn't tell you why I think that
> or if it's right. It does seem to fit empirically though.

You're absolutely right, Mark... I ran into this same thing when prepping
for my demonstration of DropTools at the LiveCode TV #29 event. I even
called Richard to confirm that this wasn't a bug.

Sure enough, messages are being locked, and there's a note in the IDE script
for the handler related to bug #8345:

# OK-2009-10-17 : Bug 8345
# We should lock messages whenver a property is get or set to prevent code
# execution caused by custom getProp / setProp handlers. Failing to do
# this causes the user to be confused about the actual value of the property
# and also could cause stacks to be broken e.g. by running code the user
# hadn't finished testing and accidently deleted objects.

I've since had to explicitly tell people using the LC IDE to set custom
properties via the Message Box (or use the MC IDE, where this doesn't
happen).


Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/






More information about the use-livecode mailing list