1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| class MenuBar(Frame):
"""Barre de menus déroulants"""
def __init__(self , boss = None):
Frame.__init__(self , borderwidth = 2)
##### menu <Fichier> #####
fileMenu = Menubutton(self , text = "Fichier" , font = ("Times" , 11 , "bold") , underline = 0)
fileMenu.pack(side = LEFT)
# partie déroulante menu Fichier
menu1 = Menu(fileMenu)
menu1.add_command(label = "Effacer" , underline = 0 , command = boss.effacer)
menu1.add_command(label = "Terminer" , underline = 0 , command = boss.quit)
# intégration du menu
fileMenu.configure(menu = menu1)
##### menu <Client> #####
self.client = Menubutton(self , text = "Clients" , font = ("Times" , 11 , "bold") , underline = 0)
self.client.pack(side = LEFT , padx = 4)
# partie déroulante menu clients
menu1 = Menu(self.client)
menu1.add_command(label = "Animaux" , underline = 0 , command = boss.showAnim)
menu1.add_command(label = "Maîtres" , underline = 0 , command = boss.showMaitr)
# intégration du menu
self.client.configure(menu = menu1) |
Partager