Connecting Tech Pros Worldwide Forums | Help | Site Map

Clearing a Text Widget

Kane Bonnette
Guest
 
Posts: n/a
#1: Jul 23 '05
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

Kane Bonnette
Guest
 
Posts: n/a
#2: Jul 23 '05

re: Clearing a Text Widget


Kane Bonnette wrote:[color=blue]
> 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[/color]

In case anyone's wondering, you must use 0.0 instead of 0 on a Text Widget
Eric Brunel
Guest
 
Posts: n/a
#3: Jul 25 '05

re: Clearing a Text Widget


On Fri, 22 Jul 2005 23:42:52 -0400, Kane Bonnette <gtg216r@mail.gatech.edu> wrote:
[color=blue]
> Kane Bonnette wrote:[color=green]
>> 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[/color]
>
> In case anyone's wondering, you must use 0.0 instead of 0 on a Text Widget[/color]

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

HTH
--
python -c "print ''.join([chr(154 - ord(c)) for c in 'U(17zX(%,5.zmz5(17;8(%,5.Z65\'*9--56l7+-'])"
Closed Thread


Similar Python bytes