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
-
Fasasoftware
- Posts: 203
- Joined: Mon Oct 31, 2011 9:36 pm
-
Contact:
Post
by Fasasoftware » Sun Jun 29, 2014 2:03 pm
Dear friend,
How to point the cursor to an object inside the main window?
I have tryed everything... but i can't solve this
In my script ...the cursor change the position but in a wrong coordinate and don't go at the graphic "oval"
here my code:
Code: Select all
local coordinate
on mouseUp
put the loc of graphic "oval" into coordinate
set the screenmouseloc to coordinate
end mouseUp
can you help me please?? Thanks A lot
Lestroso

-
richmond62
- Livecode Opensource Backer

- Posts: 10100
- Joined: Fri Feb 19, 2010 10:17 am
Post
by richmond62 » Sun Jun 29, 2014 2:42 pm
I just made a stack with an OVAL graphic
and set the screenMouseLoc to the loc of the graphic,
and it moved the location of the pointer to the location on
the screen and NOT the location relative to the stack.
Therefore you have to take into account where the stack is on the screen:
The stack is called "LOCKER", it contains one oval graphic "gOVAL"
and a button that contains this script:
on mouseUp
put item 1 of the loc of graphic "gOVAL" into inOVAL
put item 2 of the loc of graphic "gOVAL" into upOVAL
put item 1 of the topLeft of stack "LOCKER" into inLOCK
put item 2 of the topLeft of stack "LOCKER" into upLOCK
set the screenMouseLoc to ((inLOCK + inOVAL),(upLOCK + upOVAL))
end mouseUp
I am attaching the stack here for your convenience.
-
Attachments
-
- locker.livecode.zip
- Here is the stack I refer to.
- (633 Bytes) Downloaded 238 times
-
dunbarx
- VIP Livecode Opensource Backer

- Posts: 10331
- Joined: Wed May 06, 2009 2:28 pm
Post
by dunbarx » Sun Jun 29, 2014 3:38 pm
Hi.
Just a little more compact:
Code: Select all
set the screenmouseLoc to the left of this stack + the left of grc 1 & "," & the top of this stack + the top of grc 1
This gives you to topleft corner. But you get the idea.
Craig Newman
-
Fasasoftware
- Posts: 203
- Joined: Mon Oct 31, 2011 9:36 pm
-
Contact:
Post
by Fasasoftware » Sun Jun 29, 2014 4:40 pm
Dear richmond62 and dunbark .....many thanks to you!!!
You have solved in full my problem!!!
I don't have any words to thank you....
Best regards,
Lestroso

-
jmburnod
- VIP Livecode Opensource Backer

- Posts: 2729
- Joined: Sat Dec 22, 2007 5:35 pm
-
Contact:
Post
by jmburnod » Sun Jun 29, 2014 5:02 pm
Hi,
What about ?
Code: Select all
set the screenmouseLoc to globalloc(the loc of grc 1)
Best
Jean-Marc
https://alternatic.ch
-
Fasasoftware
- Posts: 203
- Joined: Mon Oct 31, 2011 9:36 pm
-
Contact:
Post
by Fasasoftware » Sun Jun 29, 2014 9:20 pm
Dear Jean-Marc,
your script is the best!!!! Only few commands and run perfectly!!!!
But i want to thank you everybody!!! Very Kind support...
Best regards,
Lestroso
