#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Posts
    12
    Rep Power
    0

    clear Text widget


    Hi

    I'am using Tkinter module and I have created a Text widget.

    I want to use the delete method to clear all text in the text widget.

    This method takes two arguments, two indexes where the text inbetween is removed. At least as I understood it

    The problem is I don't know what the index is for the first element. END is the last element...

    a = Text(....)

    a.delete(???, END)

    Zero doesnt work...
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    394
    Rep Power
    52
    Hi!

    The first index must have the form line.colunm, where linenumbering begins with 1 and columns with 0.
    Code:
    a.delete(1.0,END)
    This should do what you want.

    Regards, mawe

IMN logo majestic logo threadwatch logo seochat tools logo