Get caret position in pixel in RichtextCtrl

88 Views Asked by At

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

1

There are 1 best solutions below

0
tom10 On BEST ANSWER

When the user clicks on the position where you want to show the context menu, get x and y from the event:

def _OnClick(self, evt):
    x, y = evt.GetX(), evt.GetY()