It work for me using Python 3.12.3. You could upgrade Python 3.13.3 instead of 3.9
Use self to call App --> self.app.exit
self
self.app.exit
self.button = ttk.Button(self, text='Exit', command=self.app.exit)