set bottom left corner of stack to clicklocation

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: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
makeshyft
Posts: 187
Joined: Mon Apr 15, 2013 4:41 am
Contact:

set bottom left corner of stack to clicklocation

Post by makeshyft » Mon Jan 19, 2015 9:39 pm

Hi everyone, I'm working on a multi-monitor setup (which I suspect is part of the difficulty), and I'm trying to accomplish a very simply thing, open a stack and set its bottom left corner to the location of where the user clicked the mouse. due to the differences in how loc is calculated for stacks, I can't seem to figure out how to do this. Maybe its just one of those days....

Any help would be appriciated
Tom @
http://www.makeshyft.com
---------------------------------
Changing the Future, Today!

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Location: Plymouth, UK
Contact:

Re: set bottom left corner of stack to clicklocation

Post by dave.kilroy » Mon Jan 19, 2015 11:01 pm

hi makeshyft - you could use:

Code: Select all

on mousedown
   set the bottomleft of the current stack to the screenmouseloc
end mousedown
Inside the script of a card or stack. However I've just tested it and found it rather hard to control the position of the stack - if you wanted to modify it so that the effect only takes place if the user clicks whilst ctrl is down the code would change to:

Code: Select all

on mousedown
   if controlkey() = "down" then set the bottomleft of the current stack to the screenmouseloc
end mousedown
"...this is not the code you are looking for..."

makeshyft
Posts: 187
Joined: Mon Apr 15, 2013 4:41 am
Contact:

[Solved] Re: set bottom left corner of stack to clicklocatio

Post by makeshyft » Mon Jan 19, 2015 11:23 pm

Thank you so much Dave .....I was close .... I worked with mouseloc and clickloc. ty.
Tom @
http://www.makeshyft.com
---------------------------------
Changing the Future, Today!

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”