Centering Card ontop of another card

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
gpearson
Posts: 84
Joined: Wed Feb 03, 2010 12:55 pm

Centering Card ontop of another card

Post by gpearson » Thu Mar 27, 2014 6:33 pm

I have a primary stack that is 562W x 732H and has 3 card within it. I have a substack of this primary stack that has a size of 400W x 400H. My question is when I click a button to show the substack, how can I center it on the primary stack?


The idea is to allow the user to click a button and have a new window open up to make changes to the application. Then on save it will close this "Window"
---
Graham Pearson
Goshen, IN USA

We Are Closed Today is your single internet resource for Indiana Area School Closings, Visit http://www.weareclosedtoday.com

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

Re: Centering Card ontop of another card

Post by dunbarx » Thu Mar 27, 2014 6:36 pm

Hi.

Use the "loc" property:

set the loc of stack "stack 2" to the loc of stack "stack 1"

Craig Newman

EDIT.

It occurs to me that you also may want to ensure that the stack you are centering is the "topStack". Otherwise who knows what might happen?

That was meant to be homework.

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: Centering Card ontop of another card

Post by magice » Thu Mar 27, 2014 7:34 pm

Just my 2 cents, but I have gotten away from using substacks in the way you described. I prefer to create a group consisting of an opaque graphic, (make it look like a dialog box if you prefer) and all the controls you would put on the substack. Then just change the "visible" of that group. That eliminates annoying problems like having openStack sent every time the substack is opened. There is nothing wrong about the way you have approached the problem, I just find the other way to be easier for me.

Post Reply