zl程序教程

您现在的位置是:首页 >  其它

当前栏目

Tkinter之Label

Label tkinter
2023-09-14 08:59:37 时间
复制代码
#coding: utf8

from Tkinter import *

def tklabel(event):

 s = Label(root, text="IloveXin")

 s.pack()


labelA = Label(root, text="learn tkinter", background="green") labelB = Label(root, text="learn tkinter", background="red") labelC = Label(root, text="learn tkinter", background="blue") b1 = Button(root, text="click", command=tklabel) b2 = Button(root, text="click") b2[width] = 30 b2[height] = 6 b2[background] = pink b2.bind(" Button-1 ", tklabel) b1.pack() b2.pack() labelA.pack() labelB.pack() labelC.pack()