Tkinter.Text widget - how to get text cursor position?

A

Alex9968

Is it possible to get position (in numbers) of the insertion cursor? As
I understood, Text widget uses mark named INSERT to store it, which is
available globally by just referencing INSERT, but how could I get
actual coordinate numbers of the mark?
I need this because I want not just to insert string at, but to examine
text before and after the insertion cursor. I can probably use .get() to
extract the halves of text before and after cursor, but it'd be better
just to know the position.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top