Next / Previous / Contents / Shipman's homepage

5.13. ScrolledList.clear(): Empty the listbox

Removes all lines from the listbox. The .delete() method on a Listbox object takes two arguments, a start position and an end position. A zero value refers to the start of the listbox, and the constant END refers to the position just after the last line.

scrolledlist.py
    def clear(self):
        """Remove all lines.
        """
        self.listbox.delete(0, tk.END)