Re: x,y coordinates of text cursor in body

2015-06-11 Thread Edward K. Ream
On Sat, May 30, 2015 at 10:11 AM, john lunzer lun...@gmail.com wrote: it's not the mouse position that we're looking for but the text cursor position. ​You may find the following functions ​useful: @file leoGlobals.py--g.Indices, Strings, Unicode Whitespace--g.Indices ​EKR​ -- You

Re: x,y coordinates of text cursor in body

2015-05-31 Thread reinhard . engel . de
Your'e welcome! Didn't know someone else was following my postings...:) Reinhard On Sunday, May 31, 2015 at 1:46:55 PM UTC+2, john lunzer wrote: BTW, thank you Reinhard for getting me moving in the right direction. Knowledgeable as always :) -- You received this message because you are

Re: x,y coordinates of text cursor in body

2015-05-31 Thread john lunzer
BTW, thank you Reinhard for getting me moving in the right direction. Knowledgeable as always :) On Saturday, May 30, 2015 at 11:11:54 AM UTC-4, john lunzer wrote: While this is definitely interesting and useful it's not the mouse position that we're looking for but the text cursor position.

Re: x,y coordinates of text cursor in body

2015-05-30 Thread jkn
Hi John On Friday, 29 May 2015 13:38:34 UTC+1, john lunzer wrote: I've been playing around with trying to extract the x,y screen coordinates of the text cursor in the body but I've come up short. I found QTextCursor but it's position method does not give screen coordinates like QCursor does

Re: x,y coordinates of text cursor in body

2015-05-30 Thread john lunzer
c.frame.body.widget.cursorRect() will give you the location of the cursor relative to the text body, I think relative to the top left corner. I think that: c.frame.body.widget.getContentsMargins() also needs to be factored into this, ie added to whatever you get from cursorRect() What I can't

Re: x,y coordinates of text cursor in body

2015-05-30 Thread reinhard . engel . de
Since Leo works with PyQT/Qt, a look there might help, i.e. http://www.qtcentre.org/threads/3073-How-to-get-mouse-s-position Reinhard On Saturday, May 30, 2015 at 3:20:03 PM UTC+2, john lunzer wrote: c.frame.body.widget.cursorRect() will give you the location of the cursor relative to the

Re: x,y coordinates of text cursor in body

2015-05-30 Thread john lunzer
While this is definitely interesting and useful it's not the mouse position that we're looking for but the text cursor position. However I think this put me on the right track. So c.frame.body.widget.cursorRect() will provide something like: PyQt4.QtCore.QRect(52, 4, 3, 26) if that were

x,y coordinates of text cursor in body

2015-05-29 Thread john lunzer
I've been playing around with trying to extract the x,y screen coordinates of the text cursor in the body but I've come up short. I found QTextCursor but it's position method does not give screen coordinates like QCursor does with its pos method. Any help would be greatly appreciated. -- You