The following is a list of miscellaneous widgets offered by Pmw:
- Balloon
- Blt (used for graph generation)
- The Color Module functions
Pmw provides the Balloon widget implementation, which will be used in the current example. Begin by importing Pmw into the namespace, as follows (see code 5.09—view.py):
import Pmw
Next, instantiate the Balloon widget within the create_gui method, as follows:
self.balloon = Pmw.Balloon(self.root)
Finally, bind the Balloon widget to each button widget in the audio player. We will not reproduce the code for each button. However, the format is as follows:
balloon.bind(name of widget, 'Description for the balloon')
Thus, the Add File button will have a balloon binding, as follows:
self.balloon.bind(add_file_button, 'Add New File')
Add similar code for each button in 5.09—view.py.
This completes the iteration. We added Balloon tooltips to the audio player's buttons using the Pmw Tkinter extension. Most importantly, we got to know about the Tkinter extensions and when to use them.
This brings us to the end of this chapter. The audio player is ready!