Commit 3480d913 by BellCodeEditor

auto save

parent 172fdfee
Showing with 16 additions and 3 deletions
...@@ -7,7 +7,7 @@ alist = ["星期六下午打篮球", "星期天下午和小美一起看电影", ...@@ -7,7 +7,7 @@ alist = ["星期六下午打篮球", "星期天下午和小美一起看电影",
class Note(): class Note():
def __init__(self): def __init__(self):
self.root = tkinter.Tk() self.root = tkinter.Tk()
self.root.geometry('300x340+1000+200') self.root.geometry('300x340+400+200')
self.root.title("我的便签-待办事项") self.root.title("我的便签-待办事项")
self.root.resizable(width=True, height=False) # True可以拉伸,False不能拉伸 self.root.resizable(width=True, height=False) # True可以拉伸,False不能拉伸
self.bg_img = tkinter.PhotoImage(file="duck.png") self.bg_img = tkinter.PhotoImage(file="duck.png")
...@@ -26,10 +26,22 @@ class Note(): ...@@ -26,10 +26,22 @@ class Note():
self.but = tkinter.Button(self.root,text='添加',font=('宋体', 12), self.but = tkinter.Button(self.root,text='添加',font=('宋体', 12),
bg="lightblue", width=5,command=self.get_info) bg="lightblue", width=5,command=self.get_info)
self.but.place(x=240, y=305) self.but.place(x=240, y=305)
#事项
self.y = 20
for i in alist:
self.canvas.create_text(40,self.y,text = i,font=('宋体', 12),
anchor = W,fill = '#CC0033')
self.y += 30
def get_info(self): def get_info(self):
pass a = self.ent.get()
if a != '':
self.canvas.create_text(40,self.y,text = a,font=('宋体', 12),
anchor = W,fill = '#CC0033')
self.y += 30
alist.append(a)
self.ent.delete('0',END)
app = Note() app = Note()
app.show() app.show()
app.root.mainloop() app.root.mainloop()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment