bollet.c
1 year ago
3 changed files with 14 additions and 60 deletions
@ -1,58 +1,12 @@ |
|||
from tkinter import * |
|||
from tkinter.messagebox import showinfo |
|||
|
|||
|
|||
class Accueil(Tk): |
|||
"""interface graphique pour les paramètres""" |
|||
def __init__(self): |
|||
super().__init__() |
|||
|
|||
# root |
|||
self.title("Jeu de rôle") |
|||
self.geometry('500x500') |
|||
|
|||
|
|||
titre = Label(self, text="Bienvenue", font=("Arial", 42)).pack() |
|||
sous_titre = Label(self, text="Veuillez Choisir un personnage", font=("Arial", 10)).pack() |
|||
#choix du personnage |
|||
frameChoixPerso = LabelFrame(self, text="Choix du personnage", padx=20, pady=20) |
|||
frameChoixPerso.pack(fill="both", expand="yes") |
|||
|
|||
Label(frameChoixPerso, text="A l'intérieure de la frame").pack() |
|||
|
|||
|
|||
choixPerso = Listbox(frameChoixPerso) |
|||
self.listePersos = ["guerrier","magicien","voleur","elfe"] |
|||
for i in range(len(self.listePersos)): |
|||
choixPerso.insert(i, self.listePersos[i]) |
|||
|
|||
choixPerso.pack() |
|||
|
|||
|
|||
def add_label(self, txt): |
|||
Label(self, text=txt).pack() |
|||
|
|||
def add_entry(self, default): |
|||
self.entry_value = default |
|||
Entry(self, textvariable=self.entry_value, width=30).pack() |
|||
|
|||
class FenetreCombat(Tk): |
|||
class FenetreCombat(): |
|||
def __init__(self, nom, texte_de_presentation): |
|||
"""initialise une interface graphique pour un combat""" |
|||
self.root = App(nom) |
|||
|
|||
"""initialise une interface pour un combat""" |
|||
self.texte_de_presentation = texte_de_presentation |
|||
|
|||
self.root.add_label("bonjour") |
|||
self.root.add_entry("sodvuhmwsoudvhmwsouvh") |
|||
|
|||
combat_btn = Button(self.root, text="Combattre", command=self.combattre) |
|||
pasCombat_btn = Button(self.root, text="Ne pas combattre", command=self.pasCombattre) |
|||
def combattre(self): |
|||
pass |
|||
def pasCombattre(self): |
|||
pass |
|||
def fenetreCombat(nom, texte_de_presentation): |
|||
root = App(nom) |
|||
root.add_label("bonjour") |
|||
root.add_entry("sodvuhmwsoudvhmwsouvh") |
|||
self.instructions() |
|||
def instructions(self): |
|||
print(texte_de_presentation) |
|||
def affiche_fichier(path): |
|||
with open(path, 'r') as file: |
|||
for line in file: |
|||
print(line) |
Loading…
Reference in new issue