import tkinter as tk from tkinter import ttk from tkinter.messagebox import showinfo class App(tk.Tk): def __init__(self, nom): super().__init__() # root self.title(nom) self.geometry('500x500') def add_label(self, txt): ttk.Label(self, text=txt).pack() def add_entry(self, default): entry_value = default ttk.Entry(self, textvariable=entry_value, width=30).pack() class FenetreCombat(tk.Tk): def __init__(self, nom, texte_de_presentation): """initialise une interface graphique pour un combat""" self.root = App(nom) self.texte_de_presentation = texte_de_presentation self.root.add_label("bonjour") self.root.add_entry("sodvuhmwsoudvhmwsouvh") self.root.add_label(entry_value) combat_btn = tk.Button(self.root, text="Combattre", command=self.combattre) pasCombat_btn = tk.Button(self.root, text="Ne pas combattre", command=self.pasCombattre) def combattre(self): pass def pasCombattre(self): pass app = FenetreCombat("sdf", "txt pre")