Page 1 of 1

Setting the location of an Answer Dialog

Posted: Fri May 30, 2008 11:50 pm
by gyroscope
Hallo, how do I script to set the loc of an answer/ask dialog please?

Also, I've been using

Code: Select all

set the loc of this stack to the screenloc
which works fine, except from the bottom of the screen to the bottom of the window includes the menu bar's height as extra. I know this has been asked before on the Forum but after spending twenty minutes trying to find the post without success, I thought I'd ask the question again, if that's OK:

Could anyone help with that neat bit of scripting to centre the window to the screen exactly please? (If I put my mind to it, I probably could work it out, but it'd be clumsy coding, I'm sure... :wink: )

:)

Posted: Sat May 31, 2008 12:51 am
by Mark
Hi Gyroscope,

This subject came up several times on the Mail List. You might find something useful here.

Best,

Mark

Posted: Tue Jun 03, 2008 2:17 pm
by gyroscope
Thank you Mark, I keep forgetting that Mail List for info!

:)

Posted: Tue Jun 03, 2008 5:03 pm
by FourthWorld
Rather than the screenloc, you may find it more consistent with other dialogs to have the position slightly above center. I use this function to place the dialog horizontally centered but only two-fifths down from the top:

function AlertLoc
return item 1 of the screenLoc, (item 4 of the screenRect div 5 )*2
end AlertLoc

Posted: Tue Jun 03, 2008 11:55 pm
by gyroscope
Thank you Richard, for the neat function. I'll certainly be using that!

:)

Re: Setting the location of an Answer Dialog

Posted: Thu Aug 14, 2014 4:19 pm
by keram
Hi Richard and gyroscope,
FourthWorld wrote:function AlertLoc
return item 1 of the screenLoc, (item 4 of the screenRect div 5 )*2
end AlertLoc
Could you please explain more in details how to use this function?

Thanks!

keram