Tkinter, icursor() method on a Text widget

S

snx7s

Hi,

using Tkinter, on a Text widget i would like to place the cursor to a
given position like the icursor() method of the Entry widget.
Is it possible do that, if it is how please ?

Thank You.
 
P

Peter Otten

snx7s said:
Hi,

using Tkinter, on a Text widget i would like to place the cursor to a
given position like the icursor() method of the Entry widget.
Is it possible do that, if it is how please ?

Thank You.

Use text.mark_set(Tkinter.INSERT, "5.2") to move the cursor to column 2 in
row 5, where columns start at 0 and the first line is 1.
There are other more complicated forms, like text.mark_set(Tkinter.INSERT,
"1.0 +100 chars") which goes to the hundreth char (counting newlines).

For details and the general concept behind this, see
http://www.nmt.edu/tcc/help/pubs/tkinter.pdf


Peter
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top