As the title sugges开发者_如何学Cts, how can i get the coordinates of the cursor in the EditText ? im not trying to get the cursor position here but the screen coordinates of the cursor.
im trying to show a popup relative to that cursor, therefore i need to determine the cursor coordinates first.
You could use (not runnable):
tc = wx.TextCtrl(...)
pop = wx.PopupWindow(...)
x, y = tc.PositionToXY(tc.GetInsertionPoint)
pos = wx.Point(x,y)
pop.Move(pos)
Note that this would include any scrolled distance in the textctrl which you may want to negate (subtract however much you've scrolled from y before creating pos)
精彩评论