Commit 037dcc00 by BellCodeEditor

save project

parent c4f0160f
Showing with 42 additions and 14 deletions
import tkinter import tkinter
from tkinter import * from tkinter import *
alist=["罗靖翔出生了","罗靖翔长大了","罗靖翔结婚了","罗靖翔和他老婆生了一个儿子和一个女儿","罗靖翔带全家环游世界","他们先去日本喝核废水","他们再去缅北嘎腰","最后全在缅北去世"]
alist = ["星期六下午打篮球", "星期天下午和小美一起看电影",
"12月18日给蒂法过生日", "12.24送妈妈圣诞礼物"]
class Note(): # 便签、笔记 class Note(): # 便签、笔记
def __init__(self): def __init__(self):
self.root = tkinter.Tk() self.root = tkinter.Tk()
...@@ -32,8 +29,15 @@ class Note(): # 便签、笔记 ...@@ -32,8 +29,15 @@ class Note(): # 便签、笔记
for info in alist: for info in alist:
self.canvas.create_text(40, self.y, text=info, self.canvas.create_text(40, self.y, text=info,
font=("宋体", 11), anchor=W, fill='#FF9900') font=("宋体", 11), anchor=W, fill='#FF9900')
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.va+=1
self.y += 30 self.y += 30
def remove(self):
num=self.v.get()
alist.pop(num)
self.canvas.destroy()
app.show()
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)
...@@ -41,10 +45,12 @@ class Note(): # 便签、笔记 ...@@ -41,10 +45,12 @@ class Note(): # 便签、笔记
alist.append(info) alist.append(info)
self.canvas.create_text(40,self.y,text=info,font=("宋体",11), self.canvas.create_text(40,self.y,text=info,font=("宋体",11),
anchor=W, fill='#FF9900') anchor=W, fill='#FF9900')
self.select=tkinter.Radiobutton(self.canvas,image=self.box,value=self.val,variable=self.v,width=25,height=15,borderwidth=0)
self.select.place(x=-20,y=self.y-10)
self.va+=1
self.y += 30 self.y += 30
app = Note() app = Note()
app.show() app.show()
app.root.mainloop() app.root.mainloop()
\ No newline at end of file
import tkinter import tkinter
root = tkinter.Tk() root = tkinter.Tk()
root.geometry('300x340+500+200') root.geometry('400x400')
canvas = tkinter.Canvas(root, width=300, height=340, bg="lightblue") root.title("罗靖翔、陈琸行和邝焯尔的档案")
canvas = tkinter.Canvas(root, width=400, height=400, bg="lightblue")
canvas.place(x=0, y=0) canvas.place(x=0, y=0)
# ++++++++++++++++++++++++++++++++++++++++++++++++++++ # ++++++++++++++++++++++++++++++++++++++++++++++++++++
def func(): def func():
...@@ -17,10 +18,29 @@ rb4 = tkinter.Radiobutton(root,text='罗靖翔和他老婆生了一个儿子和 ...@@ -17,10 +18,29 @@ rb4 = tkinter.Radiobutton(root,text='罗靖翔和他老婆生了一个儿子和
rb5 = tkinter.Radiobutton(root,text='罗靖翔带他全家去环游世界',value=5,variable=v,command=func) rb5 = tkinter.Radiobutton(root,text='罗靖翔带他全家去环游世界',value=5,variable=v,command=func)
rb6 = tkinter.Radiobutton(root,text='他们先去日本喝核废水',value=6,variable=v,command=func) rb6 = tkinter.Radiobutton(root,text='他们先去日本喝核废水',value=6,variable=v,command=func)
rb7 = tkinter.Radiobutton(root,text='再去缅北嘎腰',value=7,variable=v,command=func) rb7 = tkinter.Radiobutton(root,text='再去缅北嘎腰',value=7,variable=v,command=func)
rb8 = tkinter.Radiobutton(root,text='',value=8,variable=v,command=func) rb8 = tkinter.Radiobutton(root,text='最后在缅北去世',value=8,variable=v,command=func)
# ++++++++++++++++++++++++++++++++++++++++ rb1 = tkinter.Radiobutton(root,text='罗靖翔出生了',value=1,variable=v,command=func)
rb1.place(x=50,y=50) rb2 = tkinter.Radiobutton(root,text='罗靖翔的成长',value=2,variable=v,command=func)
rb2.place(x=50,y=100) rb3 = tkinter.Radiobutton(root,text='罗靖翔结婚了',value=3,variable=v,command=func)
rb3.place(x=50,y=150) rb4 = tkinter.Radiobutton(root,text='罗靖翔和他老婆生了一个儿子和一个女儿',value=4,variable=v,command=func)
rb4.place(x=50,y=200) rb5 = tkinter.Radiobutton(root,text='罗靖翔带他全家去环游世界',value=5,variable=v,command=func)
rb6 = tkinter.Radiobutton(root,text='他们先去日本喝核废水',value=6,variable=v,command=func)
rb7 = tkinter.Radiobutton(root,text='再去缅北嘎腰',value=7,variable=v,command=func)
rb8 = tkinter.Radiobutton(root,text='最后在缅北去世',value=8,variable=v,command=func)
rb1 = tkinter.Radiobutton(root,text='罗靖翔出生了',value=1,variable=v,command=func)
rb2 = tkinter.Radiobutton(root,text='罗靖翔的成长',value=2,variable=v,command=func)
rb3 = tkinter.Radiobutton(root,text='罗靖翔结婚了',value=3,variable=v,command=func)
rb4 = tkinter.Radiobutton(root,text='罗靖翔和他老婆生了一个儿子和一个女儿',value=4,variable=v,command=func)
rb5 = tkinter.Radiobutton(root,text='罗靖翔带他全家去环游世界',value=5,variable=v,command=func)
rb6 = tkinter.Radiobutton(root,text='他们先去日本喝核废水',value=6,variable=v,command=func)
rb7 = tkinter.Radiobutton(root,text='再去缅北嘎腰',value=7,variable=v,command=func)
rb8 = tkinter.Radiobutton(root,text='最后在缅北去世',value=8,variable=v,command=func)# ++++++++++++++++++++++++++++++++++++++++
rb1.place(x=150,y=10)
rb2.place(x=150,y=60)
rb3.place(x=150,y=110)
rb4.place(x=150,y=160)
rb5.place(x=150,y=210)
rb6.place(x=150,y=260)
rb7.place(x=150,y=310)
rb8.place(x=150,y=360)
root.mainloop() root.mainloop()
\ No newline at end of file
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