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 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 figure out is how to determine where the top left corner of > the text body starts on the screen. I've poured over the members and > methods for c.frame, c.frame.body, and c.frame.body.widget and I couldn't > find it. > > Hopefully somebody more knowledgeable can weigh in. > > On Saturday, May 30, 2015 at 6:13:26 AM UTC-4, jkn wrote: >> >> 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 with its pos method. >>> >>> Any help would be greatly appreciated. >>> >> >> I too would be interested in 'recipes' in this area... >> >> Regards >> Jon N >> >> > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
