In order to integrate our FindWindow class with our TextArea, we will need to add some functionality to one of them. We can choose to keep the logic inside either class. For this example, I will put all of the searching logic into the TextArea instead of the FindWindow, but it could easily be kept in either one.
Bring back up your textarea.py file ready for editing. We are going to begin with one more import statement at the top:
import tkinter.messagebox as msg
We will be using the messagebox module to convey information to the user regarding the results of their searches. We have met this module already in Chapter 1, Meet Tkinter.
When the user enters text to be searched for in the find area, we will highlight ...