[SOLVED] Centering the main stack

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
andy60
Posts: 25
Joined: Sun Jan 18, 2015 6:51 pm
Contact:

[SOLVED] Centering the main stack

Post by andy60 » Sun Jan 25, 2015 5:02 pm

hi, in stack scripts i have the following code:

Code: Select all

on centerMe theStackName
   set the loc of stack theStackName to the screenLoc
end centerMe
I can hit the window with this code, used with a button:

Code: Select all

on mouseUp
   centerME "CONTACTS DEMO"
end mouseUp
but if I try to enter the code centerME in my preopenstack handler, i have no result.

thx for the help.


, but if I try to enter the code in preopenstack handler, does not work
Last edited by andy60 on Mon Jan 26, 2015 6:09 am, edited 1 time in total.
Andy Bertini
Linux: Mint 17.1 Cinnamon - Gambas 3.6.2 - Gridbox 2.99.174 patched
Mac: OSX Yosemite - Livecode Community 7.0
Blog mzSoftware: http://crmforce.netsons.org/myzone
Email: and.bertini@gmail.com

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

Re: Centering the main stack

Post by magice » Sun Jan 25, 2015 5:11 pm

It will not work on preOpenSack, because the stack is not open to be acted on. Try it on openStack with send.

Code: Select all

send "centerME CONTACTS DEMO" to me in 10 milliseconds

andy60
Posts: 25
Joined: Sun Jan 18, 2015 6:51 pm
Contact:

Re: Centering the main stack

Post by andy60 » Sun Jan 25, 2015 6:17 pm

magice wrote:It will not work on preOpenSack, because the stack is not open to be acted on. Try it on openStack with send.

Code: Select all

send "centerME CONTACTS DEMO" to me in 10 milliseconds
no action...question...can i insert centerMe in opencard?
Andy Bertini
Linux: Mint 17.1 Cinnamon - Gambas 3.6.2 - Gridbox 2.99.174 patched
Mac: OSX Yosemite - Livecode Community 7.0
Blog mzSoftware: http://crmforce.netsons.org/myzone
Email: and.bertini@gmail.com

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Centering the main stack

Post by Dixie » Sun Jan 25, 2015 8:10 pm

Code: Select all

on preOpenStack
   set the loc of this stack  to screenLoc()
end preOpenStack

andy60
Posts: 25
Joined: Sun Jan 18, 2015 6:51 pm
Contact:

Re: Centering the main stack

Post by andy60 » Mon Jan 26, 2015 6:06 am

Dixie wrote:

Code: Select all

on preOpenStack
   set the loc of this stack  to screenLoc()
end preOpenStack
thx
Andy Bertini
Linux: Mint 17.1 Cinnamon - Gambas 3.6.2 - Gridbox 2.99.174 patched
Mac: OSX Yosemite - Livecode Community 7.0
Blog mzSoftware: http://crmforce.netsons.org/myzone
Email: and.bertini@gmail.com

eddier
Posts: 3
Joined: Thu Apr 02, 2015 4:40 pm

Re: Centering the main stack

Post by eddier » Wed May 06, 2015 9:14 pm

magice wrote:It will not work on preOpenSack, because the stack is not open to be acted on. Try it on openStack with send.

Code: Select all

send "centerME CONTACTS DEMO" to me in 10 milliseconds
The lesson for CenterMe at states that it does work on PreOpenStack??? Of course, I cannot share the URL, but it's on LiveCode's lesson server. I cannot find the command in the dictionary though...

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: [SOLVED] Centering the main stack

Post by FourthWorld » Wed May 06, 2015 9:47 pm

On Linux systems some window managers make it difficult for apps to place their own windows, insisting instead on using OS settings to manage them. This is most evident when using the OS' "Smart" window placement options ( in Ubuntu per Unity Tweak, gconf, or Compiz Config), but at times most other settings also yield unpredictable results.

This has been confirmed by the core dev team:
http://quality.runrev.com/show_bug.cgi?id=14313

As a workaround you can set the loc twice, once on preOpenStack and again on openStack after the window manager has rendered the window. In some cases this may result in the window jumping into position, but may be more desirable than not having it in its designation location at all.

If you're seeing this on anything other than Linux please note your OS version so we can explore this further.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply