Controling the positioning of a substack when opened

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
EzCoder
Posts: 10
Joined: Sun Sep 30, 2007 12:05 am

Controling the positioning of a substack when opened

Post by EzCoder » Sat Mar 08, 2008 1:41 pm

I've spent quite a while doing a search for this info, but it seems to be eluding me...

I have a "splash type" substack that I need to open in a certain position, based of the current location of the mainstack. (Possibly even based on the position of a certain control in the mainstack in fact.) I cannot seem to be able to find the coordinates of the main window or specific control once it's been moved by the user.

Any tips as to where I can find this info in the documentation?

Thanks,
EZ

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Sat Mar 08, 2008 2:06 pm

Code: Select all

put the location of stack xyz -- based on the screen
put the location of [button|field|whatever] xyz -- based on the stack/card
You already knew it without noticing :)

Also possibly of use:

Code: Select all

put the screenLoc -- center of screen
put the screenRect -- rectangle of the screen
put the rectangle of this card -- rectangle of window, based on stack eg. 0,0,519,466
put the rectangle of this stack -- same, but based on screen, eg. 168,212,687,678
And finally, sometimes one needs these instead of the location:
topleft property
bottomleft property
topright property
bottomright property

Said all that, maybe the "movestack" message is exactly what you want?
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

EzCoder
Posts: 10
Joined: Sun Sep 30, 2007 12:05 am

Post by EzCoder » Sat Mar 08, 2008 2:28 pm

Ah... that is just too easy!

Once again, I guess I was trying my best to make it harder than it really is with Rev. :roll:

Thank you SO MUCH for the helpful boost!

EZ

Post Reply