The Ttk Treeview
For users to be able to view the contents of a CSV file and select records to edit, we'll need to implement a new view in the application capable of displaying tabular data. This record list view will allow our users to browse the content of the file and open records for viewing or editing.
Our users are accustomed to seeing this data in a spreadsheet, laid out in a table-like format, so it makes sense to design our view in a similar fashion.
For building table-like views with selectable rows, Tkinter gives us the Ttk Treeview widget. To build our record list view, we'll need to learn about Treeview
.
Anatomy of a Treeview
To help us explore the treeview, let's go through a few basic terms and concepts related to the widget. A treeview is designed to display hierarchical data; that is, data that is organized into nodes, where each node can have exactly one parent node and zero or more child nodes. The following diagram shows an example...