May 2018
Beginner to intermediate
452 pages
11h 26m
English
Currently, our data model object is only created in the on_save() method, and is recreated every time the user saves. Some of the other callbacks we're going to write will need access to the model as well, so instead we'll create a single data model instance that can be shared by all the methods when the Application class is started or whenever a new filename is chosen. Let's take a look at the following steps:
self.filename = tk.StringVar(value=default_filename)
self.data_model = m.CSVModel(filename=self.filename.get())