-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtk_6.py
More file actions
48 lines (42 loc) · 1.18 KB
/
Copy pathtk_6.py
File metadata and controls
48 lines (42 loc) · 1.18 KB
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
44
45
46
47
48
import tkinter as tk
t = tk.Tk()
print('I am created as a menu for Mr.Jha')
t.title('Menu made By Mr.Jha')
def men():
print('New file Opened ')
m = tk.Message(t, text='New file opened')
m.pack()
def sav():
print('File has been saved')
m1 = tk.Message(t, text='file saved')
m1.pack()
t.geometry('400x300')
m = tk.Menu(t)
f = tk.Menu(m, tearoff=0)
t.config(menu=m)
f.add_command(label='New', command=men)
f.add_command(label='New Project')
f.add_command(label='Open')
f.add_command(label='Save', command=sav)
f.add_command(label='Save as')
f.add_separator()
f.add_command(label='Settings')
f.add_separator()
f.add_command(label='Exit', command=t.quit)
m.add_cascade(label='File', menu=f)
ed = tk.Menu(m, tearoff=0)
ed.add_command(label='Undo')
ed.add_command(label='Redo')
ed.add_separator()
ed.add_command(label='Cut')
ed.add_command(label='Copy')
ed.add_command(label='Copy Path')
ed.add_command(label='Paste')
ed.add_command(label='Delete')
m.add_cascade(label='Edit', menu=ed)
h = tk.Menu(m, tearoff=0)
h.add_command(label='Help')
h.add_separator()
h.add_command(label='About')
m.add_cascade(label='Help', menu=h)
t.mainloop()