Commit 0fd73865 by BellCodeEditor

auto save

parent 540f1360
Showing with 12 additions and 1 deletions
......@@ -36,11 +36,16 @@ class Note(): # 便签、笔记
# 用Radiobutton()方法渲染出单选框组件
self.select = tkinter.Radiobutton(self.canvas,image=self.box,
value=self.val,variable=self.v,width=25,height=15,
borderwidth=0)
borderwidth=0,command=self.remove)
self.select.place(x=-20, y=self.y-10) # 位置设置
self.val += 1 # 每次循环value对应的参数值增加1
self.y += 30
def remove(self): # def对应remove()方法,参数为self
num = self.v.get() # 变量num设为
alist.pop(num)
self.canvas.destroy() # 画布销毁
app.show() # 用show()方法将界面内容重新渲染出来
def get_info(self):
info = self.ent.get()
self.ent.delete("0", END)
......@@ -48,6 +53,12 @@ class Note(): # 便签、笔记
alist.append(info)
self.canvas.create_text(40,self.y,text=info,font=("宋体",11),
anchor=W, fill='#FF9900')
# 用Radiobutton()方法渲染出单选框组件
self.select = tkinter.Radiobutton(self.canvas,image=self.box,
value=self.val,variable=self.v,width=25,height=15,
borderwidth=0,command=self.remove)
self.select.place(x=-20, y=self.y-10) # 位置设置
self.val += 1 # 每次循环value对应的参数值增加1
self.y += 30
......
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