[07 Jan 2010] About HW4.5s X=layer(NIL, stuff)

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
Bugala
Posts: 936
Joined: Sun Feb 14, 2010 7:11 pm

[07 Jan 2010] About HW4.5s X=layer(NIL, stuff)

Post by Bugala »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 07 Jan 2010 11:54:17 -0000

Now how does that new (HW4.5) NIL thing work in layers in practice.

For if i do:

Code: Select all

newlayerid=Circle(stuff)
setlayername(newlayerid, "mylayername")
it works fine,

but if i then add third line of:

Code: Select all

makebutton(NIL, #LAYERBUTTON, newlayerid...)
it keeps complaining that argument 3 needs a string.

When i check with DebugPrint, it gives me answer to newlayerid as being "NIL"

So how can it anyway set that serlayername correctly to correct layerid with that NIL, but not work on makebutton?

Of course there was no problem in practice since i simply referred third argument as "mylayername" and fixed the problem, but just in case i need it at some other point, it would help to understand how this works.

For i thought it would return some number for newlayerid, depending on what numbered ID is next one free instead of NIL.

Bugala
Posts: 936
Joined: Sun Feb 14, 2010 7:11 pm

[07 Jan 2010] Re: About HW4.5s X=layer(NIL, stuff)

Post by Bugala »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 07 Jan 2010 14:44:35 -0000

Hmm, now this really puzzles me how this works or if this is just a bug, but:

I had in my code:

Code: Select all

newlayer=print("time")
serlayername(newlayer, "text-time")
showlayer("text-time", 10, 10)
and it worked as supposed.

then i did a change to it:

Code: Select all

newlayer=CreateTextObject(NIL, "time")
setlayername(newlayer, "text-time")
and it keeps complaining:

Number expected in argument one on line 346 (which is that serlayername line)

Either this is bug, or i really dont get how that NIL works in Hollywood4.5.

Oh and to add, im using in this same program several times this NIL in way of

Code: Select all

newlayer=circle(stuff)
setlayername(newlayer, "name")
and nmayn aother variables, even some conatining that NIL in their arguments and have no problem. Only this one bugs.

PEB
Posts: 536
Joined: Sun Feb 21, 2010 1:28 am

[07 Jan 2010] Re: About HW4.5s X=layer(NIL, stuff)

Post by PEB »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 07 Jan 2010 16:56:23 -0000

You are not creating a layer with this code.
newlayer=CreateTextObject(NIL, "time") setlayername(newlayer, "text-time")
You have only created a text object at this point. You need to display the text object before a layer will be created for it; or you could use InsertLayer() instead.

Locked