Re: Tied up in Layers …..
Klaus on-rev
klaus at major.on-rev.com
Sat Sep 8 12:40:36 EDT 2012
Hi Francis,
Am 08.09.2012 um 18:26 schrieb Francis Nugent Dixon <effendi at wanadoo.fr>:
> Hi from Beautiful Brittany,
>
> I'v written a stack with many phases of execution,
> and have literally dozens of fields and buttons on
> layers assigned by LiveCode when created.
>
> Some of these objects are "shown" when they should
> be "invisible" behind objects on a higher layer.
> Others are "hidden" when they should be "visible"
> in front of objects on a lower layer.
>
> I hope I make myself clear……..
>
> Instead of manually shifting all these objects to
> suitable layers, and driving myself bonkers in the
> process, I have two questions :
>
> 1 - Can I list the current layer of all objects in
> my card, with a script ?
Yes!
...
repeat with i = 1 to the num of controls ## of cd x of stack y
put the name of control i & TAB & the layer of control i & CR After tLayerList
end repeat
delete char -1 of tLayerList
## do something with tLayerList :-)
## field "name of field" TAB 1
## button "othe button" TAB 2
## etc...
...
Beware of DataGrids! :-D
> 2 - Can I then set the layers of the objects by a
> script, to put them into layers convenient to
> me.
Sure you can "set the layer of XXX to YYY", I do this all the time :-)
Of course you need to be careful with objects in groups!
> Documentation SEEMS to specify that I can "Get" a
> layer number for an object, but can't "Set" it.
SHOULD work!
> Any solutions ?
>
> -Francis
Best
Klaus
--
Klaus Major
http://www.major-k.de
klaus at major.on-rev.com
More information about the use-livecode
mailing list