May 2018
Beginner to intermediate
452 pages
11h 26m
English
Let's start working through these with our __init__() method:
def __init__(self, parent, fields, settings, callbacks, *args, **kwargs):
self.callbacks = callbacks
We're adding a new argument, callbacks, and storing it as an instance property. This will give the controller a way to provide methods for the view to call.
Next, our __init__() method should set up a variable in which to store the current record:
self.current_record = None
We'll use None to indicate that no record is loaded and the form is being used to create a new record. Otherwise, this value will be an integer referencing a row in the CSV data.
We could use a Tkinter variable here, but there's no real advantage in this case, and we wouldn't be able to ...