-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnote_pad.py
More file actions
109 lines (80 loc) · 3.28 KB
/
note_pad.py
File metadata and controls
109 lines (80 loc) · 3.28 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
from tkinter import *
def writingpad():
tk = Tk()
entryF = Entry(tk,width = 30 )
entryF.pack(pady = 70 , padx = 40)
entryF.place(y = 43,x = 95)
tk.title ('creating file')
tk.geometry('300x200')
tk.config(bg = 'grey')
lab1 = Label(tk,text ='File name |',font = 'lucida 12 ',bg = 'grey',fg = 'white')
lab1.pack()
lab1.place(y = 40,x = 10)
lab2 = Label(tk,text = 'Creating file...',bg = 'grey',fg = 'white',font = 'lucida 14 bold')
lab2.pack()
lab1 = Label(tk,text ='width |',font = 'lucida 12 ',bg = 'grey',fg = 'white')
lab1.pack()
lab1.place(y = 65,x = 10)
lab1 = Label(tk,text ='height |',font = 'lucida 12 ',bg = 'grey',fg = 'white')
lab1.pack()
lab1.place(y = 100,x = 10)
entryW = Entry(tk,width = 30)
entryW.pack(pady = 70 , padx = 40)
entryW.place(y = 70 , x = 95)
entryl = Entry(tk,width = 30)
entryl.pack(pady = 70 , padx = 40)
entryl.place(y = 104, x = 95)
tk.resizable(False,False)
def creat():
tk = Tk()
entryF = Entry(tk,width = 30 )
entryF.pack(pady = 70 , padx = 40)
entryF.place(y = 43,x = 95)
tk.title ('creat a new file')
tk.geometry('300x200')
tk.config(bg = 'grey')
lab1 = Label(tk,text ='File name |',font = 'lucida 12 ',bg = 'grey',fg = 'white')
lab1.pack()
lab1.place(y = 40,x = 10)
lab2 = Label(tk,text = 'Cret a new file',bg = 'grey',fg = 'white',font = 'lucida 14 bold')
lab2.pack()
lab1 = Label(tk,text ='width |',font = 'lucida 12 ',bg = 'grey',fg = 'white')
lab1.pack()
lab1.place(y = 65,x = 10)
lab1 = Label(tk,text ='height |',font = 'lucida 12 ',bg = 'grey',fg = 'white')
lab1.pack()
lab1.place(y = 100,x = 10)
entryW = Entry(tk,width = 30)
entryW.pack(pady = 70 , padx = 40)
entryW.place(y = 70 , x = 95)
entryl = Entry(tk,width = 30)
entryl.pack(pady = 70 , padx = 40)
entryl.place(y = 104, x = 95)
buttonlogin = Button(tk, text='Creat', width=4, height=1, bg='grey', fg='white', font='lucida 12 bold',
command=notpad)
buttonlogin.pack()
buttonlogin.place(y=150, x=130)
tk.resizable(False,False)
def notpad():
notpad = Tk()
notpad.title(entryF.get())
notpad.geometry(f'{entryl.get()}x{entryW.get()}')
notpad.resizable(False,False)
text = Text(notpad,width = entryW.get(),height = entryl.get())
text.pack()
menubar = Menu(notpad)
def quiting():
notpad.quit()
file = Menu(menubar,tearoff = 0)
menubar.add_cascade(label = 'file',menu = file)
file.add_command(label = 'save')
file.add_command(label = 'Rename file')
file.add_separator()
file.add_command(label='Exit note pad',command = quiting)
menubar.add_cascade(label = 'new',command = creat)
notpad.config(menu = menubar)
notpad.mainloop()
buttonlogin = Button(tk,text = 'Creat',width = 4,height = 1,bg = 'grey',fg = 'white',font= 'lucida 12 bold',command = notpad)
buttonlogin.pack()
buttonlogin.place(y = 150,x = 130)
tk.mainloop()