From 5058456f4c94f96ea4e2fb326b5d2235f1a6cde8 Mon Sep 17 00:00:00 2001 From: jerem <114385056+Jerem-EstIcI@users.noreply.github.com> Date: Mon, 22 Apr 2024 15:54:49 +0200 Subject: [PATCH] petits changements --- main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.py b/main.py index 1bed8ad..5c8fc32 100644 --- a/main.py +++ b/main.py @@ -16,11 +16,16 @@ canvas.pack() def affiche_lab(): + ''' + Affiche le labyrinthe sur l'application tkinter + ''' dim=25 # dimension du labyrinthe (max lisible 101) dimcanva=500/dim + gen = GenLab(dim) # GenLab(dimension) labyrinthe = gen.dessine_lab() + canvas.config(width=len(labyrinthe[0]) * dimcanva, height=len(labyrinthe) * dimcanva) canvas.delete("all") # Effacer tout ce qui est dessiné précédemment sur le canvas @@ -37,6 +42,8 @@ def affiche_lab(): canvas.create_rectangle(j * dimcanva, i * dimcanva, (j + 1) * dimcanva, (i + 1) * dimcanva, fill="white") + + gen_button = tk.Button(button_frame, text="Générer Labyrinthe", command=affiche_lab) gen_button.pack(side=tk.LEFT, padx=5, pady=5)