Commit 28f587ac by BellCodeEditor

auto save

parent 9a0bb824
Showing with 8 additions and 2 deletions
......@@ -13,6 +13,7 @@ class Note():
self.bg_img = tkinter.PhotoImage(file="bg.png")
self.box = tkinter.PhotoImage(file='box.png')
def show(self):
self.canvas = tkinter.Canvas(self.root, width=300,
height=340, bg="lightblue")
......@@ -34,10 +35,15 @@ class Note():
self.canvas.create_text(40,self.y,text=info,font=("宋体", 11),
anchor=W, fill='#FF9900')
self.select = tkinter.Radiobutton(self.canvas,image=self.box,variable=self.v,value=self.val,
width=25, height=15,borderwidth=1)
width=25, height=15,borderwidth=1,command=self.remove)
self.select.place(x=-20,y=self.y-10)
self.val += 1
self.y += 30
def remove(self):
num = self.v.get()
alist.pop(num)
self.canvas.destroy()
app.show()
def get_info(self):
info = self.ent.get()
......@@ -47,7 +53,7 @@ class Note():
self.canvas.create_text(40, self.y, text=info,
font=("宋体", 11), anchor="w", fill='#FF9900')
self.select = tkinter.Radiobutton(self.canvas,image=self.box,variable=self.v,value=self.val,
width=25, height=15,borderwidth=1)
width=25, height=15,borderwidth=1,command=self.remove)
self.select.place(x=-20,y=self.y-10)
self.val += 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