Is it possible to get the x y coordinates of the insertion cursor in a Tkinter Text widget? I’m trying to make a popup menu that pops up next to the insertion cursor.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
bboxmethod can be used to get the bounding box of an index. You can use that to get the position relative to the window. You can use thewinfomethod to get the x/y of the window.Typically popups appear next to the mouse rather than the insertion point (though typically, right-clicking first sets the insertion point and then displays a menu).