Building our widgets

Let's think through what classes we need to implement with our new ValidatedMixin class, as follows:

  • All our fields except Notes are required, so we'll need a basic Entry widget that registers an error if there's no input.
  • We have one Date field, so we need an Entry widget that enforces a valid date string.
  • We have a number of the Spinbox widgets for decimal or integer input. We'll need to make sure these only accept valid number strings.
  • We have a few Combobox widgets that don't behave quite the way we want them to.

Let's get started!

Get Python GUI Programming with Tkinter now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.