Commit 731dfdb6 by BellCodeEditor

save project

parent 3d2bc658
Showing with 12 additions and 4 deletions
......@@ -16,6 +16,7 @@ class Note(): # 便签、笔记
def remove(self):
mum = self.v.get()
alist.pop(mum)
self.canvas.destroy()
self.show()
def show(self): # 布置窗口界面
......@@ -29,20 +30,20 @@ class Note(): # 便签、笔记
self.ent.place(x=10, y=310)
# 按钮
self.but = tkinter.Button(self.root,text='添加',font=('宋体', 12),
bg="lightblue", width=25, command=self.get_info)
bg="lightblue", width=5, command=self.get_info)
self.but.place(x=240, y=305)
# 展示所有的文字
self.v = tkinter.IntVar()
self.y = 20
val = 0
self.val = 0
for info in alist:
self.canvas.create_text(40, self.y, text=info,
font=("宋体", 11), anchor=W, fill='#FF9900')
self.rb = tkinter.Radiobutton(self.canvas,image =self.box,value=val,
self.rb = tkinter.Radiobutton(self.canvas,image =self.box,value=self.val,
variable=self.v,command = self.remove)
self.rb.place(x=-30,y=self.y-15)
self.y += 30
val += 1
self.val += 1
def get_info(self):
info = self.ent.get()
......@@ -51,7 +52,14 @@ class Note(): # 便签、笔记
alist.append(info)
self.canvas.create_text(40,self.y,text=info,font=("宋体",11),
anchor=W, fill='#FF9900')
self.rb = tkinter.Radiobutton(self.canvas,image =self.box,value=self.val,
variable=self.v,command = self.remove)
self.rb.place(x=-30,y=self.y-15)
self.y += 30
val += 1
app = Note()
......
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