diff --git a/main.pyw b/main.pyw index 06c2434..58c0bb7 100644 --- a/main.pyw +++ b/main.pyw @@ -14,5 +14,14 @@ for file in os.listdir(PATH_MODULE): # On cherche les modules dans leur dossier exec(module.read()) # On les executes +class AppClass(): # Classe du "moteur" du jeu + def __init__(self): # Initialisation + classModule["display"].write("lancer une partie") + + def navigation(key): + pass + # Navigation avec les touches du simon dans le menu principal + +App = AppClass() mainloop() # On "active" la fênetre diff --git a/module/button.py b/module/button.py index e69de29..3b34955 100644 --- a/module/button.py +++ b/module/button.py @@ -0,0 +1,10 @@ +class button(): + def __init__(self): # Cette fonction est automatiquement éxécuter lors de la création de l'objet + self.frame = LabelFrame(Fen, text = "Button") # On créer une sous-fenêtre + self.frame.grid(row = 2, column = 3, sticky = "NEWS") # On l'affiche + + self.big_but = Button(self.frame, text = "", background = "lightgray", width = 8, height = 5, relief = GROOVE) # On créer le boutton du haut + self.big_but.grid(row = 1, column = 1) + + +classModule["button"] = button() diff --git a/module/display.py b/module/display.py index 4b387a8..ddf1c34 100644 --- a/module/display.py +++ b/module/display.py @@ -6,5 +6,8 @@ class display(): self.label = Label(self.frame, text = "ici on affichera le texte") self.label.grid(row = 1, column = 1, sticky = "NEWS") + def write(self, text): + self.label.config(text = text) + classModule["display"] = display() diff --git a/module/morse.py b/module/morse.py index e69de29..6d715d4 100644 --- a/module/morse.py +++ b/module/morse.py @@ -0,0 +1,16 @@ +class morse(): + def __init__(self): # Cette fonction est automatiquement éxécuter lors de la création de l'objet + self.frame = LabelFrame(Fen, text = "Morse") # On créer une sous-fenêtre + self.frame.grid(row = 2, column = 2, sticky = "NEWS") # On l'affiche + + self.frame.grid_rowconfigure(1, weight = 1) # tout les objets seront centré horizontalement + self.frame.grid_columnconfigure(1, weight = 1) # tout les objets seront centré verticalement + + + self.morse = Label(self.frame, text = "", background = "lightgray", relief = SUNKEN, width = 2, height = 1) + self.morse.grid(row = 1, column = 1) + + + + +classModule["morse"] = morse() diff --git a/module/simon.py b/module/simon.py index f7512a4..07b5636 100644 --- a/module/simon.py +++ b/module/simon.py @@ -14,9 +14,13 @@ class simon(): 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"] = Button(self.frame, text = "", background = "lightyellow", width = 2, height = 1) # On créer le boutton self.dico_but["Down"].grid(row = 4, column = 2) + def MainMenu(self): + pass + # Bind les touches pour agir sur le menu principal + classModule["simon"] = simon()