- def initUI(self):
- self.parent.title("Personnages : Un exemple d'héritage et de polymorphisme")
- self.pack(fill=BOTH, expand=True)
- self.menubar = Menu(self)
- menu = Menu(self.menubar, tearoff=0)
- self.menubar.add_cascade(label="Fichier", menu=menu)
- menu.add_command(label="Ouvrir...", command=self.menuOuvrir_Click)
- # ajouter les autres options
- menu.add_command(label="Enregistrer", command=self.menuEnregistrer_Click)
- menu.add_command(label="Enregistrer sous...", command=self.menuEnregistrerSous_Click)
- menu.add_command(label="Vider liste", command=self.menuViderListe_Click)
- menu.add_command(label="Quitter", command=self.menuQuitter_Click)
- self.master.config(menu=self.menubar)
- # frame 1 (droite)
- frame_1 = Frame(self.parent)
- frame_1.pack(side=RIGHT, fill=Y)
- # frame 2 (gauche)
- frame_2 = Scrollbar(width=20)
- frame_2.pack(side=RIGHT, fill=Y)
- # Ajout de labels dans les frames
- # Ajout du listbox
- self.listbox = Listbox(self.parent, yscrollcommand=frame_2.set)
- self.listbox.pack(fill=BOTH, expand=True)
- # Ajout de bouttons
- # Reste les command à faire, les imports de fonction dans gestion_personnages ne fonctionne pas??
- Button(frame_1, text='Créer un sorcier',height=3, width=25,padx=10,pady=10,bd=5).pack()
- Button(frame_1, text='Créer un guerrier',height=3, width=25,padx=10,pady=10,bd=5).pack()
- Button(frame_1, text='Attaquer',height=3, width=25,padx=10,pady=10,bd=5).pack()
- Button(frame_1, text='Réinitialiser l\'énergie',height=3, width=25,padx=10,pady=10,bd=5).pack()
- Button(frame_1, text='Crier',height=3, width=25,padx=10,pady=10,bd=5).pack()
[text] tp3
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new:
File Description
- tp3
- Paste Code
- 30 Jun-2022
- 1.8 Kb
You can Share it:
Latest Code Pastes