-
Notifications
You must be signed in to change notification settings - Fork 0
/
Menu_bar.py
43 lines (33 loc) · 884 Bytes
/
Menu_bar.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from tkinter import *
window = Tk()
#Create menu bar
menubar = Menu(window, bg= 'light blue')
window.config(menu= menubar)#Assign it to the window
fileMenu= Menu(menubar, tearoff= 0, bg= 'white', font=('Times New Roman', 15))#created first menu
menubar.add_cascade(label='File',
menu= fileMenu
)#Creates a dropdown
#lets asd menus to our cascade
fileMenu.add_command(label='Open'
#command= open
)
fileMenu.add_command(label='Save',
#command= save
)
fileMenu.add_separator()#adds a seperator
fileMenu.add_command(label='Exit',
command= quit)
#second Menu (Edit Menu)
editmenu = Menu(menubar, tearoff= 0, bg='light yellow', font=('Times New Roman', 15))
menubar.add_cascade(label='Edit',
menu=editmenu)
editmenu.add_command(label='Cut',
#command= cut
)
editmenu.add_command(label='Copy',
#command= copy
)
editmenu.add_command(label='Paste',
#command=paste
)
window.mainloop()