Commit 533f8e9b authored by Thorfin89's avatar Thorfin89

Réglage des Frames et des boutons v2

parent bceb1fa1
60 28
\ No newline at end of file \ No newline at end of file
...@@ -16,6 +16,16 @@ class Pupitre: ...@@ -16,6 +16,16 @@ class Pupitre:
self.root.geometry("800x480") self.root.geometry("800x480")
self.root.resizable(width=False, height=False) self.root.resizable(width=False, height=False)
self.root.attributes('-fullscreen', False) # < A basculer sur False pour les test sur PC self.root.attributes('-fullscreen', False) # < A basculer sur False pour les test sur PC
# définition des zones
# bandeau supérieur
self.bandeau = tk.Frame(self.root, width="800", height="80", bg='gray')
self.bandeau.pack(side=TOP, expand='True')
# fenêtre contenant les boutons (vignettes) des radios
self.vignettes = tk.Frame(self.root, width="500", height="400", bg='black')
self.vignettes.pack(side=LEFT, expand='True')
# fenêtre d'affichage de la radio en cours de lecture, et des boutons de commande
self.menu = tk.Frame(self.root, width="300", height="400")
self.menu.pack(side=RIGHT, expand='True')
# images des boutons # images des boutons
self.icon_play = tk.PhotoImage(file="icons/play.png") self.icon_play = tk.PhotoImage(file="icons/play.png")
...@@ -24,43 +34,30 @@ class Pupitre: ...@@ -24,43 +34,30 @@ class Pupitre:
self.icon_sound = tk.PhotoImage(file="icons/sound_up.png") self.icon_sound = tk.PhotoImage(file="icons/sound_up.png")
self.icon_mute = tk.PhotoImage(file="icons/mute.png") self.icon_mute = tk.PhotoImage(file="icons/mute.png")
self.zones() self.commandes()
def boucle(self): def boucle(self):
self.root.mainloop() self.root.mainloop()
# noinspection PyTypeChecker def commandes(self):
def zones(self):
# fenêtre Haute : Titre / Menu
bandeau = tk.Frame(self.root, width="800", height="80", bg='gray')
bandeau.pack(side=TOP, expand='True')
# fenêtre contenant les boutons (vignettes) des radios
vignettes = tk.Frame(self.root, width="500", height="400", bg='black')
vignettes.pack(side=LEFT, expand='True')
# fenêtre d'affichage de la radio en cours de lecture, et des boutons de commande
menu = tk.Frame(self.root, width="300", height="400")
menu.pack(side=RIGHT, expand='True')
# boutons de commande # boutons de commande
btn_play = ttk.Button(menu, image=self.icon_play, text="Play", command=self.radio_play) btn_play = ttk.Button(self.menu, image=self.icon_play, text="Play", command=self.radio_play)
btn_play.grid(row=1, column=0) btn_play.grid(row=1, column=0)
btn_pause = ttk.Button(menu, image=self.icon_pause, text="Pause", command=self.radio_pause) btn_pause = ttk.Button(self.menu, image=self.icon_pause, text="Pause", command=self.radio_pause)
btn_pause.grid(row=1, column=1) btn_pause.grid(row=1, column=1)
btn_stop = ttk.Button(menu, image=self.icon_stop, text="Stop", command=self.radio_stop) btn_stop = ttk.Button(self.menu, image=self.icon_stop, text="Stop", command=self.radio_stop)
btn_stop.grid(row=1, column=2) btn_stop.grid(row=1, column=2)
# potentiomètre de volume # potentiomètre de volume
lecture = open("init", "r") # on charge configuration sauvegardée lecture = open("init", "r") # on charge configuration sauvegardée
volume_init = lecture.read() volume_init = lecture.read()
lecture.close() lecture.close()
vol_potar = Scale(menu, from_=0, to=100, tickinterval=20, orient=HORIZONTAL, length=206, label="Volume", vol_potar = Scale(self.menu, from_=0, to=100, tickinterval=20, orient=HORIZONTAL, length=206, label="Volume",
command=self.volume) command=self.volume)
vol_potar.set(volume_init) vol_potar.set(volume_init)
vol_potar.grid(row=2, column=0, columnspan=3) vol_potar.grid(row=2, column=0, columnspan=3)
btn_stop = ttk.Button(menu, image=self.icon_mute, text="Mute", command=self.radio_mute) btn_stop = ttk.Button(self.menu, image=self.icon_mute, text="Mute", command=self.radio_mute)
btn_stop.grid(row=3, column=1) btn_stop.grid(row=3, column=1)
btn_stop = ttk.Button(menu, image=self.icon_sound, text="Sound", command=self.radio_sound) btn_stop = ttk.Button(self.menu, image=self.icon_sound, text="Sound", command=self.radio_sound)
btn_stop.grid(row=3, column=2) btn_stop.grid(row=3, column=2)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment