Setting the location of an Answer Dialog

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
gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Setting the location of an Answer Dialog

Post by gyroscope » Fri May 30, 2008 11:50 pm

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: )

:)

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sat May 31, 2008 12:51 am

Hi Gyroscope,

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

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Tue Jun 03, 2008 2:17 pm

Thank you Mark, I keep forgetting that Mail List for info!

:)

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

Post by FourthWorld » Tue Jun 03, 2008 5:03 pm

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
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Tue Jun 03, 2008 11:55 pm

Thank you Richard, for the neat function. I'll certainly be using that!

:)

keram
Posts: 340
Joined: Fri Nov 08, 2013 4:22 am

Re: Setting the location of an Answer Dialog

Post by keram » Thu Aug 14, 2014 4:19 pm

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
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit

Post Reply