Does somebody knows how to create a custom context menu in a TextCtrl object using wxPython ?
For the moment, I could create a custom menu but this one appears at the mouse cursor position , when the original one appears at the text cursor position when hitting the [Menu] key .
Okay,
Could somehow do the trick but this works only
Simply: getting the position of the text cursor into row/column coordinates and multiplying them by the character size. This gives the desired popup menu position.
Update #1 -> Size of characters taken from
font.GetPixelSize()
Update #2 -> Position of scrolling bar taken under account using
self.GetScrollPos()