O'Reilly logo

Tkinter GUI Programming by Example by David Love

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Integrating our FindWindow class

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required