Page 380 -
P. 380
graphical interface elements
track = mixer.Sound(sound_file)
track_playing = IntVar()
track_button = Checkbutton(app, variable = track_playing,
command = track_toggle,
text = sound_file)
track_button.pack(side = LEFT)
Put the tkinter volume = DoubleVar()
code here. volume.set(track.get_volume())
volume_scale = Scale(variable = volume,
from_ = 0.0,
to = 1.0,
resolution = 0.1,
command = change_volume,
label = “Volume",
orient = HORIZONTAL)
volume_scale.pack(side = RIGHT)
def shutdown():
track.stop()
app.destroy()
app.protocol("WM_DELETE_WINDOW", shutdown)
app.mainloop()
you are here 4 345