Page 1 of 1

[SOLVED] Centering the main stack

Posted: Sun Jan 25, 2015 5:02 pm
by andy60
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

Re: Centering the main stack

Posted: Sun Jan 25, 2015 5:11 pm
by magice
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

Re: Centering the main stack

Posted: Sun Jan 25, 2015 6:17 pm
by andy60
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?

Re: Centering the main stack

Posted: Sun Jan 25, 2015 8:10 pm
by Dixie

Code: Select all

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

Re: Centering the main stack

Posted: Mon Jan 26, 2015 6:06 am
by andy60
Dixie wrote:

Code: Select all

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

Re: Centering the main stack

Posted: Wed May 06, 2015 9:14 pm
by eddier
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...

Re: [SOLVED] Centering the main stack

Posted: Wed May 06, 2015 9:47 pm
by FourthWorld
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.