Page 1 of 1

Get location of click in scrolling field

Posted: Fri Apr 24, 2015 8:16 pm
by trenatos
Is it possible to get the line number of where a user clicks in a scrolling field?

Re: Get location of click in scrolling field

Posted: Fri Apr 24, 2015 8:19 pm
by trenatos
Woo, answering lots of my own questions today.

on mouseDown
put word 2 of the clickline
end mouseDown

Re: Get location of click in scrolling field

Posted: Fri Apr 24, 2015 9:00 pm
by FourthWorld
Well done, Marcus. You'll make us obsolete in no time. :)

Re: Get location of click in scrolling field

Posted: Fri Apr 24, 2015 10:14 pm
by Klaus
Love it! :D

Re: Get location of click in scrolling field

Posted: Fri Apr 24, 2015 10:44 pm
by trenatos
In this case I'm mimicking the Sublime IDE mini-map, so with that I can grab the line clicked in the mini-map, multiply by line-height in the target window, and set the scroll to the right position :)

Re: Get location of click in scrolling field

Posted: Fri Apr 24, 2015 11:22 pm
by Klaus
You cunning fox! :D