-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path36.Notepad.py
59 lines (41 loc) · 1.88 KB
/
36.Notepad.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from tkinter import *
import tkinter as tks
from tkinter import IntVar
tk = Tk()
tk.geometry('500x500')
tk.title('Notepad')
main_menu = tks.Menu()
file = Menu(main_menu, tearoff = False)
edit = Menu(main_menu, tearoff = False)
view = Menu(main_menu, tearoff = False)
theme = Menu(main_menu, tearoff = False)
main_menu.add_cascade(label= "File", menu = file)
main_menu.add_cascade(label= "Edit", menu = edit)
main_menu.add_cascade(label= "View", menu = view)
main_menu.add_cascade(label= "Theme", menu = theme)
view.add_checkbutton(label="Tool Bar", onvalue=True, offvalue=False, compound=tks.LEFT)
view.add_checkbutton(label="Status Bar", onvalue=True, offvalue=False, compound=tks.LEFT)
file.add_command(label ="New", compound = tks.LEFT, accelerator = "Ctrl +N")
file.add_command(label ="Open", compound = tks.LEFT, accelerator = "Ctrl +O")
file.add_command(label ="Save", compound = tks.LEFT, accelerator = "Ctrl +S")
file.add_command(label ="Save as", compound = tks.LEFT, accelerator = "Ctrl +NS")
file.add_command(label ="Exit", compound = tks.LEFT, accelerator = "Ctrl +Esc")
edit.add_command (label = 'Copy' , compound = tks.LEFT, accelerator = 'ctrl+C')
edit.add_command (label = 'Paste' , compound = tks.LEFT, accelerator = 'ctrl+V')
edit.add_command (label = 'Cut' , compound = tks.LEFT, accelerator = 'ctrl+X')
edit.add_command (label = 'Clear' , compound = tks.LEFT, accelerator = 'ctrl+alt+x')
edit.add_command (label = 'Find' , compound = tks.LEFT, accelerator = 'ctrl+F')
color_dict = {
'Light Default ' : ('#000000', '#ffffff'),
'Light Plus' : ('#474747', '#e0e0e0'),
'Dark' : ('#c4c4c4', '#2d2d2d'),
'Red' : ('#2d2d2d', '#ffe8e8'),
'Monokai' : ('#d3b774', '#474747'),
'Night Blue' :('#ededed', '#6b9dc2')
}
count = 0
for i in color_dict:
theme.add_radiobutton(label = i , compound = tks.LEFT)
count +=1
tk.config(menu=main_menu)
tk.mainloop()