Discussion:
Get caret position in x,y pixel in RichtextCtrl
Nagarajan Babu
2014-09-09 06:48:03 UTC
Permalink
How we get caret position in x,y pixel to window. i tried following method
but it only gives column and row for given position.

windowCaretPosition = self.__editor.PositionToXY(self.__editor.GetInsertionPoint())

it returns tuple with column and row. but i need x,y point show to context
menu near caret when key up
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
i***@gmail.com
2014-09-10 00:45:11 UTC
Permalink
Have you tried

windowCaretPosition = self.__editor.GetCaret().GetPosition()

I'm not sure if its in screen coords but you could calculate that.
Post by Nagarajan Babu
How we get caret position in x,y pixel to window. i tried following method
but it only gives column and row for given position.
windowCaretPosition = self.__editor.PositionToXY(self.__editor.GetInsertionPoint())
it returns tuple with column and row. but i need x,y point show to context
menu near caret when key up
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nagarajan Babu
2014-09-10 04:30:46 UTC
Permalink
thank you
Post by i***@gmail.com
Have you tried
windowCaretPosition = self.__editor.GetCaret().GetPosition()
I'm not sure if its in screen coords but you could calculate that.
Post by Nagarajan Babu
How we get caret position in x,y pixel to window. i tried following
method but it only gives column and row for given position.
windowCaretPosition = self.__editor.PositionToXY(self.__editor.GetInsertionPoint())
it returns tuple with column and row. but i need x,y point show to
context menu near caret when key up
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...