Geometry in latest version of RunRev
Dave
dave at looktowindward.com
Thu Nov 1 21:41:41 EDT 2007
On 1 Nov 2007, at 15:07, Richard Gaskin wrote:
> Dave wrote:
>
>>> Sounds a lot like the GM to me. It handles a lot of basic
>>> situations well.
>> Yes, but at the drop of a hat it goes Beswick!
>
> That may not be merely a limitation of the GM, but possibly a bug.
> Did you report it? It'd be interesting to run the sample stack
> submitted with the report to find how it could be repaired.
>
>
>>> There are three main ways to refer to objects with Rev: ordinal
>>> number, name, or ID.
> ...
>>> Which of these three ways to refer to objects do you use?
>> None of them! I set a "listen" (Based on a MessageID and
>> MessageKind) in the object that wants to get the message, then I
>> just send to this MessageID and MessageKind. The object receives
>> the message, and, since it's running in the object's script, can
>> use "me".
>
> I think I may be slow this morning, as I'm not following this method.
>
> The resizeStack message is sent to the card, not the controls on
> the card. So how do these controls get notification to update
> themselve without something referring to them without using one of
> the three ways to refer to objects?
Well, in this case the resizeStack message in the Card Script would
send a "xxxResizeStack" message and any object listening for this
message would get called. The calling handler would then resize
itself using "me". No reference explicit reference to an object,
therefore any object can be cut and pasted anywhere are they will
still work and the place where they were removed from won't break.
I developed a Library ages ago I call ISM. It allows objects to
"listen" for messages on a certain key and another object to send
message to this "key" and have all "listening" objects receive the
message.
For me, it's the only way to develop modular objects that I can more
around at will with no or little backwork.
>
>> That way I can copy objects around, dupe them, whatever and other
>> parts of the stack(s) don't break!
>
> If the resizeStack handlers are replicated in the objects
> themselves, how do you handle situations like my example, where
> some object positions are determined by others?
>
When the object gets initialized it sends a message saying what it
where it is.
> And in such a case, how would the object whose position is
> dependent on another know the other object's position without
> referring to it?
The handler in the current object would refer to "me" and would
receive messages telling it where the other objects it has to worry
about are located and how to position itself relative to them.
Doing it this way makes life a LOT easier!
All the Best
Dave
More information about the use-livecode
mailing list