Implementing a record list view
The 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. Since our view mainly exists for finding and selecting individual records, we don't need to display all the information; just enough for the users to distinguish one record from another.
A quick analysis shows that we need CSV row number, Date
, Time
, Lab
, and Plot
.
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
.
The ttk Treeview
The Treeview
is a ttk widget designed to show columns of data in a hierarchical structure.
Perhaps the best example of this kind of data is a filesystem tree:
- Each row can represent a file or directory
- Each directory can contain additional files or directories...