|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
import tkinter as tk
w = tk.Tk()
w.title("牛逼")
w.geometry("400x300")
w.config(bg="orange")
v = tk.StringVar()
hit = 0
def hit_me():
global hit
if hit == 0 :
hit = 1
v.set("你点他干啥啊!")
else:
hit = 0
v.set("我不要面子吗?")
label = tk.Label(w,textvariable=v,bg="blue",fg="red",font=("楷体",30),
width=15,height=3)
label.pack()
button = tk.Button(w,text="你敢动我试试!",bg="red",fg="blue",font=("楷体",20),
width=10,height=3,command=hit_me)
button.pack(side="bottom")
w.mainloop() |
|