Skip to Content
Python GUI Programming with Tkinter
book

Python GUI Programming with Tkinter

by Alan D. Moore
May 2018
Beginner to intermediate content levelBeginner to intermediate
452 pages
11h 26m
English
Packt Publishing
Content preview from Python GUI Programming with Tkinter

Adding the menu functionality in the controller

Now that our menu class is defined, our Application object needs to create an instance and add it into the main window. Before we can do that, we'll need to define some things that our MainMenu class needs.

Remember the following things from the previous section:

  • We need a settings dictionary that contains Tkinter variables for our two settings options
  • We need a callbacks dictionary that points to callbacks for file->select and file->quit
  • We need the actual functions that implement file selection and quitting

Let's define some things that our MainMenu class needs.

Open application.py and let's start adding code just before the creation of self.recordform:

    self.settings = { 'autofill date': ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python GUI Programming with Tkinter - Second Edition

Python GUI Programming with Tkinter - Second Edition

Alan D. Moore

Publisher Resources

ISBN: 9781788835886Supplemental Content