Question about the name of the target for new graphics

Doug Lerner doug at webcrossing.com
Tue Jan 20 00:17:02 EST 2004


On 1/20/04 2:09 PM, "J. Landman Gay" <jacque at hyperactivesw.com> wrote:

> On 1/19/04 11:06 PM, Doug Lerner wrote:
> 
>> 
>> I am creating a graphic with the
>> 
>> new graphic newName
>> 
>> command.
>> 
>> in the newGraphic handler, if I log "the name of the target" it is the usual
>> "Graphic 1", etc, which I don't expect.
>> 
>> However, in the stack inspector the created graphics name is correct.
>> 
>> Why doesn't "the name of the target" report correctly then inside the
>> newGraphic handler?
> 
> When a new object is created, it has no properties yet. The newgraphic
> (or new-anything) message is sent before any properties are assigned. By
> the time the inspector sees the object, it is done being created and now
> has a name.

So - when does the name set in

    new graphic newName

get set so proper logging and verification can be done? Where does that
happen? I didn't see anything that did that in the internal newGraphic
handler.

Would

    set the name of the templateGraphic to newName

be helpful before the "new graphic" command? That is where I set the other
properties.

doug



More information about the use-livecode mailing list