bollet.c
1 year ago
3 changed files with 14 additions and 60 deletions
@ -1,58 +1,12 @@ |
|||||
from tkinter import * |
class FenetreCombat(): |
||||
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): |
|
||||
def __init__(self, nom, texte_de_presentation): |
def __init__(self, nom, texte_de_presentation): |
||||
"""initialise une interface graphique pour un combat""" |
"""initialise une interface pour un combat""" |
||||
self.root = App(nom) |
|
||||
|
|
||||
self.texte_de_presentation = texte_de_presentation |
self.texte_de_presentation = texte_de_presentation |
||||
|
|
||||
self.root.add_label("bonjour") |
self.instructions() |
||||
self.root.add_entry("sodvuhmwsoudvhmwsouvh") |
def instructions(self): |
||||
|
print(texte_de_presentation) |
||||
combat_btn = Button(self.root, text="Combattre", command=self.combattre) |
def affiche_fichier(path): |
||||
pasCombat_btn = Button(self.root, text="Ne pas combattre", command=self.pasCombattre) |
with open(path, 'r') as file: |
||||
def combattre(self): |
for line in file: |
||||
pass |
print(line) |
||||
def pasCombattre(self): |
|
||||
pass |
|
||||
def fenetreCombat(nom, texte_de_presentation): |
|
||||
root = App(nom) |
|
||||
root.add_label("bonjour") |
|
||||
root.add_entry("sodvuhmwsoudvhmwsouvh") |
|
Loading…
Reference in new issue