|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
内容如题,在做书上212页的例子,代码如下
from tkinter import *
#import tkinter as tk
def callback():
var.set("吹吧你,我才不信~")
def callback2():
exit()
root=Tk()
frame1=Frame(root)
frame2=Frame(root)
var=StringVar()
var.set("您所下载的影片含有未成年人限制内容,\n请满18岁后再点击观看!")
textlable=Label(frame1,
textvariable=var,
justify=LEFT)
textlable.pack(side=LEFT)
photo=PhotoImage(file="18.gif")
imglabel=Label(frame1,image=photo)
imglabel.pack(side=RIGHT)
thebutton=Button(frame2,text="已满18周岁",command=callback)
thebutton.pack()
thebutton=Button(frame2,text="退出",command=callback2)
thebutton.pack()
frame1.pack(padx=10,pady=10)
frame2.pack(padx=10,pady=10)
mainloop()
|
|