Before writing any code, be sure to make a new folder to hold the files for this chapter. Inside this folder, create a file called textarea.py. This file will hold the main part of our text editor—a subclass of the Text widget.
The Text widget is such as a textarea tag within HTML. It holds multiple lines of text and many formatting options. In the next chapter, we will see just how powerful this widget can be with the use of concepts like tags and indexing, which alter the text's appearance and give us control over certain regions of the text, allowing us to search all over the document within.
For now, we will just need a simple instance of the widget with a couple of configuration options set:
import tkinter as tk
class TextArea(tk.Text):
def __init__(self, master, **kwargs):
super().__init__(**kwargs)
self.master = master...