开发者

wxPython: how to get screen x/y for line in a RichTextCtrl?

I want to pop up a window directly beneath the current line (the line with the insertion cursor) in a RichTextCtrl. Is there a way to get the screen coordinate of a specific character or line in the control? There doesn't seem to be, but that's such a 开发者_JS百科glaring omission I figure I must be missing something.

I have lines of varying height so I can't just figure out the line, multiply by line height, and then figure out the offset from the top of the window. What are my options, or am I simply out of luck?

FWIW, I'm using python 2.5 and wxPython 2.8.9.1 (and no ability to upgrade at the moment).


Could you try to test with this function?

wx.richtext.RichTextCtrl.GetCaret().GetPosition()

when I just try that, Its return tuple with probably x, y locations of cursor, in pixel(probably)

Let me know if there is any issue with that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜