Clearing a Text Widget

K

Kane Bonnette

Does anyone know how the clear the text from a Tkinter Text Widget? The
delete(0, END) trick that works for Entry widgets doesn't work for Text

I get "0 is an invalid index" when i try to do so

Thanks in advance
 
K

Kane Bonnette

Kane said:
Does anyone know how the clear the text from a Tkinter Text Widget? The
delete(0, END) trick that works for Entry widgets doesn't work for Text

I get "0 is an invalid index" when i try to do so

Thanks in advance

In case anyone's wondering, you must use 0.0 instead of 0 on a Text Widget
 
E

Eric Brunel

In case anyone's wondering, you must use 0.0 instead of 0 on a Text Widget

In fact, you should use 1.0, which means line 1, column 0 (lines are numbered from 1 in text widgets).

HTH
 

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
474,262
Messages
2,571,310
Members
47,977
Latest member
MillaDowdy

Latest Threads

Top