Commit 4972ad1b by BellCodeEditor

save project

parent 23500ca4
Showing with 4 additions and 9 deletions
import tkinter
from tkinter import *
alist = ["西江月·夜行黄沙道中","【宋】辛弃疾","明月别枝惊鹊,清风半夜鸣蝉","稻花香里说丰年,听取蛙声一片","七八个星天外,两三点雨山前","旧时茅店社林边,路转溪桥忽见"]
alist = ["星期六下午打篮球", "星期天下午和小美一起看电影",
"12月18日给蒂法过生日", "12.24送妈妈圣诞礼物"]
class Note(): # 便签、笔记
def __init__(self):
......@@ -11,11 +12,6 @@ class Note(): # 便签、笔记
self.root.resizable(width=False, height=False)
self.bg_img = tkinter.PhotoImage(file="bg.png")
self.box= tkinter.PhotoImage(file="box.png")
def t(self):
num=self.v.get()
alist.pop(num)
self.canvas.destroy()
app.show()
def show(self): # 布置窗口界面
# 画布
self.canvas = tkinter.Canvas(self.root, width=300, height=340)
......@@ -38,7 +34,7 @@ class Note(): # 便签、笔记
for info in alist:
self.canvas.create_text(40, self.y, text=info,
font=("宋体", 11), anchor=W, fill='#FF9900')
self.rb1=tkinter.Radiobutton(self.canvas,image=self.box,value=self.val,variable=self.v,command=self.t)
self.rb1=tkinter.Radiobutton(self.canvas,image=self.box,value=self.val,variable=self.v)
self.rb1.place(x=-30,y=self.y-20)
self.val+=1
self.y += 30
......@@ -50,11 +46,10 @@ class Note(): # 便签、笔记
alist.append(info)
self.canvas.create_text(40,self.y,text=info,font=("宋体",11),
anchor=W, fill='#FF9900')
self.rb1=tkinter.Radiobutton(self.canvas,image=self.box,value=self.val,variable=self.v,command=self.t)
self.rb1=tkinter.Radiobutton(self.canvas,image=self.box,value=self.val,variable=self.v)
self.rb1.place(x=-30,y=self.y-20)
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