Implementing a record list with Treeview
Now that we understand how to use the Treeview
widget, it's time to implement a GUI that will allow us to browse the records in the CSV file and open them for editing. Let's take a moment to plan out what it is that we need to create:
- We want to lay out the CSV data in a table structure, similar to how it would look in a spreadsheet. This will be a flat table, not a hierarchy.
- Each table row will represent a record in the file. When a user double-clicks the row, or highlights it and presses Enter, we want the record form to open with the selected record.
- We don't really need to show every field in the table, since its purpose is merely to locate records for editing. Instead, we'll show only the rows that uniquely identify a record to the user. Namely, those are
Date
,Time
,Lab
, andPlot
. We can also show the CSV row number. - There isn't really a need to sort the data, so we won't implement...