Positioning control behind another..

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
tasdvl9
Posts: 94
Joined: Fri Dec 06, 2013 3:55 am

Positioning control behind another..

Post by tasdvl9 » Wed Aug 12, 2015 2:55 pm

Hello All,

I've researched the web but haven't been able to find an easy way of doing this.

I have an invisible button covering my application window. I then added another button onto the window.
How do I position the second button behind the invisible button? I tried moving the invisible button position down
and then after placing the second button moving the invisible button back up to cover the button but to no avail.

I imagine there is a setting in the property inspector to do this but I can't seem to find the correct parameter to adjust.

Thanks!

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Positioning control behind another..

Post by dunbarx » Wed Aug 12, 2015 2:58 pm

Hi.

When you say "behind", do you mean in layer order or in the location on screen?

I assume "layer" order, based on your attempt to slide one behind the other. Read about this property in the dictionary.

Craig Newman

tasdvl9
Posts: 94
Joined: Fri Dec 06, 2013 3:55 am

Re: Positioning control behind another..

Post by tasdvl9 » Wed Aug 12, 2015 3:03 pm

Actually location on the screen.

What I ended up doing was deleting the invisible button and then adding it again.
This made sure the controls were all "behind" the invisible button.

Thanks.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Positioning control behind another..

Post by dunbarx » Wed Aug 12, 2015 3:41 pm

Then you did indeed want to manage the "layer" property. What you did by deleting and adding a new control was to insure that the layer of that new control was higher than any of its cousins, and so it sat on top. Not a particularly robust a method, though it would work.

Experiment just a bit. Make two controls and overlap them. Change the "layer" of each. Watch what happens. This is the right way to do this sort of thing.

Craig

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Positioning control behind another..

Post by Simon » Wed Aug 12, 2015 8:17 pm

From the Project Browser you can just drag and drop the control to a different layer. It is showing the actual layer of the control like photoshop does.
But there is something funky about it... forget what is was :oops:

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Positioning control behind another..

Post by Klaus » Thu Aug 13, 2015 3:36 pm

Hi tasdvl9,

no need to mess around with inspector or Project brwoser, you can do this also via script!
Add this line before you make that invisible button visible again:
...
## Simply set the layer of that button to TOP and it will layered "above" all other controls
set the layer of btn "cover everything" to TOP
show btn "cover everything"
...
You get the picture :D


Best

Klaus

tasdvl9
Posts: 94
Joined: Fri Dec 06, 2013 3:55 am

Re: Positioning control behind another..

Post by tasdvl9 » Fri Aug 14, 2015 7:33 pm

Thanks for all the replies, Guys.

Much appreciated.

Post Reply