diff --git a/main.pyw b/main.pyw index 2e8f3b8..06c2434 100644 --- a/main.pyw +++ b/main.pyw @@ -14,4 +14,5 @@ for file in os.listdir(PATH_MODULE): # On cherche les modules dans leur dossier exec(module.read()) # On les executes + mainloop() # On "active" la fênetre diff --git a/module/display.py b/module/display.py index 07c464e..4b387a8 100644 --- a/module/display.py +++ b/module/display.py @@ -1,5 +1,5 @@ class display(): - def __init__(self): + def __init__(self): # Cette fonction est automatiquement éxécuter lors de la création de l'objet self.frame = LabelFrame(Fen, text = "Display") # On créer une sous-fenêtre self.frame.grid(row = 1, column = 1, sticky = "NEWS") # On l'affiche diff --git a/module/safe.py b/module/safe.py index e69de29..132ee34 100644 --- a/module/safe.py +++ b/module/safe.py @@ -0,0 +1,12 @@ +class safe(): + def __init__(self): # Cette fonction est automatiquement éxécuter lors de la création de l'objet + self.frame = LabelFrame(Fen, text = "Safe") # On créer une sous-fenêtre + self.frame.grid(row = 1, column = 3, sticky = "NEWS") # On l'affiche + + self.label = Label(self.frame, text = "", background = "lightgray", relief = SUNKEN, width = 2, height = 1) # On créer la led + self.label.grid(row = 1, column = 1) + + self.scale = Scale(self.frame, from_ = 1, to_ = 4, orient = HORIZONTAL) # On créer un scroller pour sélectionner une valeur entre 1 et 4 + self.scale.grid(row = 2, column = 1) + +classModule["safe"] = safe() diff --git a/module/simon.py b/module/simon.py index e69de29..f7512a4 100644 --- a/module/simon.py +++ b/module/simon.py @@ -0,0 +1,22 @@ +class simon(): + def __init__(self): # Cette fonction est automatiquement éxécuter lors de la création de l'objet + self.frame = LabelFrame(Fen, text = "Simon") # On créer une sous-fenêtre + self.frame.grid(row = 2, column = 1, sticky = "NEWS") # On l'affiche + + self.dico_but = {} # On créer un dictionnaire qui va contenir les objets bouttons. + + self.dico_but["Up"] = Button(self.frame, text = "", background = "lightgreen", width = 2, height = 1) # On créer le boutton du haut + self.dico_but["Up"].grid(row = 2, column = 2) + + self.dico_but["Left"] = Button(self.frame, text = "", background = "lightblue", width = 2, height = 1) # On créer le boutton à gauche + self.dico_but["Left"].grid(row = 3, column = 1) + + self.dico_but["Right"] = Button(self.frame, text = "", background = "indianred", width = 2, height = 1) # On créer le boutton à droite + self.dico_but["Right"].grid(row = 3, column = 3) + + self.dico_but["Down"] = Button(self.frame, text = "", background = "lightyellow", width = 2, height = 1) # On créer le boutton en bas + self.dico_but["Down"].grid(row = 4, column = 2) + + + +classModule["simon"] = simon() diff --git a/module/wire.py b/module/wire.py index 67efd66..2dd39c4 100644 --- a/module/wire.py +++ b/module/wire.py @@ -1,5 +1,5 @@ class wire(): - def __init__(self): + def __init__(self): # Cette fonction est automatiquement éxécuter lors de la création de l'objet self.frame = LabelFrame(Fen, text = "Wire") # On créer une sous-fenêtre self.frame.grid(row = 1, column = 2, sticky = "NEWS") # On l'affiche