Using the options database
Tkinter defines a concept called options database, a mechanism used to customize the appearance of the application without having to specify it for each widget. It allows you to decouple some widget options from the individual widget configuration, providing standardized defaults based on the widget hierarchy.
Getting ready
In this recipe, we will build an application with several widgets that have different styling, which will be defined in the options database:

How to do it...
In our example, we will add some options to the database through the option_add()
method, which is accessible from all widget classes:
import tkinter as tk class App(tk.Tk): def __init__(self): super().__init__() self.title("Options demo") self.option_add("*font", "helvetica 10") self.option_add("*header.font", "helvetica 18 bold") self.option_add("*subtitle.font", "helvetica 14 italic") self.option_add("*Button.foreground", "blue") ...