Commit 61fa5a15 by BellCodeEditor

save project

parent fdd0ea0e
Showing with 4 additions and 1 deletions
import tkinter import tkinter
from tkinter import * from tkinter import *
from tkinter import messagebox as mess
alist = ["星期六下午打篮球", "星期天下午和小美一起看电影", alist = ["星期六下午打篮球", "星期天下午和小美一起看电影",
"12月18日给蒂法过生日", "12.24送妈妈圣诞礼物"] "12月18日给蒂法过生日", "12.24送妈妈圣诞礼物"]
...@@ -46,13 +47,15 @@ class Note(): # 便签、笔记 ...@@ -46,13 +47,15 @@ class Note(): # 便签、笔记
def get_info(self): def get_info(self):
info = self.ent.get() info = self.ent.get()
self.ent.delete("0", END) self.ent.delete("0", END)
if info != "": if info != "" and len(info)<25:
alist.append(info) alist.append(info)
self.select=tkinter.Radiobutton(self.canvas,image=self.box_img,value=self.val,variable=self.v,width=25,height=15,borderwidth=0,command=self.destroy_info) self.select=tkinter.Radiobutton(self.canvas,image=self.box_img,value=self.val,variable=self.v,width=25,height=15,borderwidth=0,command=self.destroy_info)
self.canvas.create_text(40,self.y,text=info,font=("宋体",11),anchor=W, fill='#FF9900') self.canvas.create_text(40,self.y,text=info,font=("宋体",11),anchor=W, fill='#FF9900')
self.select.place(x=-20,y=self.y-10) self.select.place(x=-20,y=self.y-10)
self.val+=1 self.val+=1
self.y += 30 self.y += 30
else:
mess.showerror('错误','没有添加事项或太长了(>25个字符)')
app = Note() 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