forcing a group to stay at layer top [solved]
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
forcing a group to stay at layer top [solved]
I've set a group to layer top, and set the lockLoc of the layer to true. Subsequent controls I create are on top of the desired top group. Is there a way to keep a layer at the top and force new layers to be created underneath without constantly sending set layer messages?
Last edited by SteveTX on Sat Jul 13, 2013 8:01 pm, edited 1 time in total.
Re: forcing a group to stay at layer top
Hi Steve,
not automatically, you always need to:
...
set the layer of grp "the TOPMOST one" to top
...
On the other hand you could:
...
set the layer of the templateXXX to nnn
## where nnn is a number < the layer of grp "the TOPMOST one"
create XXX
...

Best
Klaus
not automatically, you always need to:
...
set the layer of grp "the TOPMOST one" to top
...
On the other hand you could:
...
set the layer of the templateXXX to nnn
## where nnn is a number < the layer of grp "the TOPMOST one"
create XXX
...

Best
Klaus
Re: forcing a group to stay at layer top
Just another wrinkle on what Klaus suggested, and which is less elegant than what he said but more direct (pseudocode):
on create new control
set the layer of the last control to the number of layers -1
Craig Newman
on create new control
set the layer of the last control to the number of layers -1
Craig Newman
Re: forcing a group to stay at layer top
Hm...
this will fail in this scenario:
top control is a group, which is NOT empty!
this will fail in this scenario:
top control is a group, which is NOT empty!

Re: forcing a group to stay at layer top
Klaus.
Shows you what sloppy thinking and zero testing can do for you. Now this (still pseudo):
create new control
set the layer of last control to the layer of the last group - 1 --I have seen more robust code in my day
or
set the layer of last control to 1 --seems narrow minded
Back to the scrabble board.
Craig
Shows you what sloppy thinking and zero testing can do for you. Now this (still pseudo):
create new control
set the layer of last control to the layer of the last group - 1 --I have seen more robust code in my day
or
set the layer of last control to 1 --seems narrow minded
Back to the scrabble board.
Craig
Re: forcing a group to stay at layer top
perhaps:
Code: Select all
on create new control
set the layer of the last control to (the layer of group "theTopMost" -1)
Re: forcing a group to stay at layer top
Yes, SirSteveTX wrote:perhaps:Code: Select all
set the layer of the last control to (the layer of group "theTopMost" -1)
