Emptying the playlist

The code is as follows (see code 5.03view.py):

def empty_play_list(self): self.model.empty_play_list() self.list_box.delete(0, END)

This completes our third iteration. In this iteration, we saw how to work with the Listbox widget. In particular, we saw how to add items to the Listbox widget, select a particular item from the Listbox widget, and delete one or more items from it.

You now have a playlist where you can add and delete items using the four buttons at the bottom-left corner of the audio player.

Get Tkinter GUI Application Development Blueprints - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.