Python Tkinter Bitmaps 位图

返回 Python GUI 编程


该属性用于显示位图。有以下类型的位图可用

  • "error"
  • "gray75"
  • "gray50"
  • "gray25"
  • "gray12"
  • "hourglass"
  • "info"
  • "questhead"
  • "question"
  • "warning"

示例

from Tkinter import *
import Tkinter

top = Tkinter.Tk()

B1 = Tkinter.Button(top, text ="error", relief=RAISED,\
                         bitmap="error")
B2 = Tkinter.Button(top, text ="hourglass", relief=RAISED,\
                         bitmap="hourglass")
B3 = Tkinter.Button(top, text ="info", relief=RAISED,\
                         bitmap="info")
B4 = Tkinter.Button(top, text ="question", relief=RAISED,\
                         bitmap="question")
B5 = Tkinter.Button(top, text ="warning", relief=RAISED,\
                         bitmap="warning")
B1.pack()
B2.pack()
B3.pack()
B4.pack()
B5.pack()
top.mainloop()

执行结果如下:

tkinter bitmaps 位图


返回 Python GUI 编程

查看笔记

扫码一下
查看教程更方便