templateField Broken?
Richard Gaskin
ambassador at fourthworld.com
Sat Mar 5 17:47:46 EST 2005
Dan Shafer wrote:
> Doh.
>
> But in fact, templateField does NOT work as far as I can tell. I typed
> it correctly in Rev, just transposed it in the email.
>
> Here's what I see:
>
> 1. create a new mainstack.
> 2. in msg, type "set the margins of the fieldTemplate to 10"
> 3. In msg, type "put the margins of the templateField"
> 4. Value returned is in fact 10
> 5. Create a new field by dragging from the tool palette
> 6. examine its margins. The value is 8
> 7. In msg, type again "put the margins of the templateField"
> 8. Value returned is now 8.
>
> Now, at step 5, create the field in a script with "create field." Check
> its margins. They are set to 10. But if you then create a new field by
> dragging from the palette, the margins reset to 8 and that same value
> becomes the value the margins in the templateField.
>
> Broken, no?
No. At least not the engine.
What you're seeing is a side effect of the IDE trying to make objects
with default values it feels are most appropriate.
You can create a field from script and it'll work just fine, or set the
template object before "choose field tool" and you can drag out a field
with the margins you want.
Contrary to the docs, the templateField (and all template objects) are
persistent throughout the current session.
That is, as far as the engine's concerned. The IDE may reset these
using the "reset templateField" command.
--
Richard Gaskin
Fourth World Media Corporation
__________________________________________________
Rev tools and more: http://www.fourthworld.com/rev
More information about the use-livecode
mailing list