Valider 518e54dd rédigé par Thorfin89's avatar Thorfin89
Parcourir les fichiers

Placement des boutons avec place de Tkinter

parent bceb1fa1
Chargement en cours
Chargement en cours
Chargement en cours
Chargement en cours
+1 −1
Numéro de ligne d'origine Ligne d'origine Numéro de ligne de diff Ligne de diff
60
43
 No newline at end of file
 No newline at end of file
+17 −8
Numéro de ligne d'origine Ligne d'origine Numéro de ligne de diff Ligne de diff
@@ -4,7 +4,7 @@


# import ----------------------------------
# import ----------------------------------
import tkinter as tk
import tkinter as tk
from tkinter import ttk, Scale, HORIZONTAL, LEFT, RIGHT, TOP
from tkinter import ttk, Scale, HORIZONTAL, CENTER, LEFT, RIGHT, TOP, OUTSIDE




# classes ---------------------------------
# classes ---------------------------------
@@ -43,24 +43,33 @@ class Pupitre:
        menu = tk.Frame(self.root, width="300", height="400")
        menu = tk.Frame(self.root, width="300", height="400")
        menu.pack(side=RIGHT, expand='True')
        menu.pack(side=RIGHT, expand='True')


        x_menu = 30
        y_menu = 100

        # 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(menu, image=self.icon_play, text="Play", command=self.radio_play)
        btn_play.grid(row=1, column=0)
        btn_play.place(bordermode=OUTSIDE, width=80, height=80, x=x_menu + 0, y=y_menu + 0)
        btn_pause = ttk.Button(menu, image=self.icon_pause, text="Pause", command=self.radio_pause)
        btn_pause = ttk.Button(menu, image=self.icon_pause, text="Pause", command=self.radio_pause)
        btn_pause.grid(row=1, column=1)
        btn_pause.place(bordermode=OUTSIDE, width=80, height=80, x=x_menu + 80, y=y_menu + 0)
        btn_stop = ttk.Button(menu, image=self.icon_stop, text="Stop", command=self.radio_stop)
        btn_stop = ttk.Button(menu, image=self.icon_stop, text="Stop", command=self.radio_stop)
        btn_stop.grid(row=1, column=2)
        btn_stop.place(bordermode=OUTSIDE, width=80, height=80, x=x_menu + 160, y=y_menu + 0)


        # 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(menu, from_=0, to=100, tickinterval=20, orient=HORIZONTAL, length=240, 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.place(bordermode=OUTSIDE, x=x_menu + 0, y=y_menu + 90)


        # boutons de coupure et rétablissement du son
        btn_stop = ttk.Button(menu, image=self.icon_mute, text="Mute", command=self.radio_mute)
        btn_stop = ttk.Button(menu, image=self.icon_mute, text="Mute", command=self.radio_mute)
        btn_stop.grid(row=3, column=1)
        btn_stop.place(bordermode=OUTSIDE, width=80, height=80, x=x_menu + 40, y=y_menu + 170)
        btn_stop = ttk.Button(menu, image=self.icon_sound, text="Sound", command=self.radio_sound)
        btn_stop = ttk.Button(menu, image=self.icon_sound, text="Sound", command=self.radio_sound)
        btn_stop.grid(row=3, column=2)
        btn_stop.place(bordermode=OUTSIDE, width=80, height=80, x=x_menu + 120, y=y_menu + 170)

        # info appli
        lbl_info = ttk.Label(menu, text="WebRadioPi @thorfin89", anchor=CENTER)
        lbl_info.place(bordermode=OUTSIDE, width=240, height=16, x=x_menu + 0, y=y_menu + 275)