Page 395 -
P. 395

sound panel




                              You were asked to begin by putting the create_gui() function in a separate module called
                              sound_panel.py. Then, you were to write a new version of the hfmix.pyw program that
                              uses the sound_panel.py module:

                                           from tkinter import *
                         Import all the
                         functions from    from sound_panel import *
                         the new module.
                                           import pygame.mixer



                                           app = Tk()

                                           app.title(“Head First Mix")






                                           mixer = pygame.mixer

                                           mixer.init()




                      By calling the new   create_gui(app, mixer, “50459_M_RED_Nephlimizer.wav")
                      function TWICE, you
                       create TWO sets of   create_gui(app, mixer, “49119_M_RED_HardBouncer.wav")
                       sound controls on the
                       GUI.
                                           def shutdown():
                                               track.stop()

                                               app.destroy()



                                           app.protocol(“WM_DELETE_WINDOW", shutdown)




                                           app.mainloop()






           360    Chapter 10
   390   391   392   393   394   395   396   397   398   399   400