Page 1 of 1
How to change the position of answer Dialog
Posted: Tue Mar 08, 2016 10:05 am
by kevin007
How I change the position af answer Dialog. is it possible to change the position ?

Re: How to change the position of answer Dialog
Posted: Tue Mar 08, 2016 11:07 am
by richmond62
I tired this:
on mouseUp
set the lockScreen to true
set the moveSpeed to 65000
answer "Is this the correct place?" with "yes" or "no"
move the stack "Answer Dialog" to 700,700
set the lockScreen to false
end mouseUp
but it didn't work
when I tried this in the MessageBox:
move the stack "Answer Dialog" to 700,700
and, then, tried the script the answer dialog still appeared centred on the main stack.
You will probably have to make yourself a home-made answer stack.
Re: How to change the position of answer Dialog
Posted: Tue Mar 08, 2016 11:28 am
by richmond62
Re: How to change the position of answer Dialog
Posted: Tue Mar 08, 2016 12:06 pm
by Klaus
Hi Richmond,
for years I have been asking myself why you always MOVE things,
when just SETting their LOC would be a more effective and instantaneous solution?
Best
Klaus
Re: How to change the position of answer Dialog
Posted: Tue Mar 08, 2016 7:08 pm
by richmond62
Maybe because I am NOT entirely "LOCO"
However this:
on mouseUp
toplevel stack "Answer Dialog"
set the loc of stack "Answer Dialog" to 700,700
set the lockMoves to true
answer "Is this the correct place?" with "yes" or "no"
set the lockMoves to true
end mouseUp
still doesn't work.
Re: How to change the position of answer Dialog
Posted: Tue Mar 08, 2016 7:36 pm
by Klaus
Hi Richmoind,
richmond62 wrote:Maybe because I am NOT entirely "LOCO"

AHA! I thought because you just "like to move it, move it!"
richmond62 wrote:Code: Select all
on mouseUp
toplevel stack "Answer Dialog"
set the loc of stack "Answer Dialog" to 700,700
##set the lockMoves to true
answer "Is this the correct place?" with "yes" or "no"
##set the lockMoves to true
end mouseUp
still doesn't work.
Sorry, never bothered to dive deeper into this mistery...
But I think "answer xyz" will trigger the "preopenstack" script of that stack which will override all previous
loc settings and changes of the window layering (toplevel etc.)
Best
Klaus
Re: How to change the position of answer Dialog
Posted: Tue Mar 08, 2016 8:33 pm
by richmond62
Yes, it does over ride everything, and that is USELESS if one wants the ANSWER window somewhere
other than plumb-dead-centre of your main stack.
Re: How to change the position of answer Dialog
Posted: Tue Mar 08, 2016 9:43 pm
by FourthWorld
Another option is to set the loc as a custom property in the Answer Dialog stack, and use a frontscript to trap preOpenCard, check if the name of the stack is "answer dialog", and if so set the loc per the prop.
Re: How to change the position of answer Dialog
Posted: Tue Mar 08, 2016 10:31 pm
by FredBeck
Fun!
Two handlers and a local (or whatever)
Try this with the backdrop off.
Code: Select all
local sLoc
on mouseUp
lock screen
put the loc of this stack into sLoc
set the loc of this stack to 380,380
send "ResetLoc" to me in .1 tick
answer "Is this the correct place?" with "yes" or "no"
end mouseUp
command ResetLoc
set the loc of this stack to sLoc
end ResetLoc
Is it acceptable?
Re: How to change the position of answer Dialog
Posted: Tue Mar 08, 2016 10:42 pm
by bn
Richmond linked to a very nice solution offered by RunRev Neil Roger
in script of stack
Code: Select all
local sShiftAnswer
on suspendStack
if sShiftAnswer then
if "answer dialog" is among the lines of the openStacks then
set the topLeft of stack "answer dialog" to the topLeft of this stack -- change location to what you want here in global coordinates
end if
end if
end suspendStack
setProp shiftAnswer pBool
put pBool into sShiftAnswer
end shiftAnswer
script of button:
Code: Select all
on mouseUp
set the shiftAnswer of this stack to true
answer "what time is it?" & cr & the milliseconds
set the shiftAnswer of this stack to false
end mouseUp
I just added the setProp stuff to avoid unnecessary checking on "suspendStack"
It works well for me.
Kind regards
Bernd