As you may have guessed, the FindWindow class needs to be imported at the beginning of the file:
from findwindow import FindWindow
Now, we need to create an instance whenever the user presses a key combination. Typically, a Find and Replace window appears on Ctrl and F or Ctrl and R. I will use Ctrl and F for this application:
def bind_events(self): ... self.bind('<Control-f>', self.show_find_window)def show_find_window(self, event=None): FindWindow(self.text_area)
A method called show_find_window is created, which will be responsible for showing our FindWindow popup.
Inside this method, all we need to do is instantiate the FindWindow class, passing it our TextArea to act as its master. The Toplevel class which ...