So, my purpose with this program is to store, whats displayed on the main frame, inside the drop down list, which shows the list of the rappers. So instead of just being displayed on the main frame, I want it to be hidden until the particular name of the artist (to whom the the picture, play button and stop button belongs to) is picked in the list. Please help me with this. Thank you.
This is the screenshot of the program atm. So far there are 4 things displayed on the main frame The list which was made with tkinter, picture, play button and the stop button.
import pygame
from tkinter import *
from PIL import ImageTk, Image
root = Tk()
root.title("Hip-Hop-Flow")
root.iconbitmap("22.ico")
root.geometry("800x600")
pygame.mixer.init()
class Vini:
def __init__(self):
self.rappers = ["Vinnie Paz", "Sean Price", "Big L", "Canibus"]
self.menu = StringVar()
self.menu.set("List of rappers")
siis_chamoshla = OptionMenu(root, self.menu, *self.rappers)
siis_chamoshla.configure(width=30, bg="white")
siis_chamoshla.pack()
def vinispicture(self):
self.vinniephoto = ImageTk.PhotoImage(Image.open("vini.gif"))
label = Label(image=self.vinniephoto)
label.pack()
def play_vinnie(self):
pygame.mixer.music.load("vinnie flow.mp3")
pygame.mixer.music.play(loops=0)
def stop_vinnie(self):
pygame.mixer.music.stop()
def design(self):
play_button = Button(root, text="Play", font=("Helvetica", 20),
command=self.play_vinnie)
play_button.pack(pady=20)
stop_button = Button(root, text="Stop", font=("Helvetica", 20),
command=self.stop_vinnie)
stop_button.pack(pady=20)
pazienza = Vini()
pazienza.vinispicture(), pazienza.play_vinnie(), pazienza.stop_vinnie(), pazienza.design()
root.mainloop()
