作者:小可爱小潴 | 来源:互联网 | 2023-10-13 12:33
#-*-coding:utf-8-*-Button显示文本与图像compound:指定文本与图像位置关系bitmap:指定位图fromtkinterimport*rootTk
# -*-coding:utf-8 -*-
'''
Button显示文本与图像
compound:指定文本与图像位置关系
bitmap:指定位图
'''
from tkinter import *
root = Tk()
Button(root, text = 'bottom', compound = 'bottom', bitmap = 'error').pack()
Button(root, text = 'top', compound = 'top', bitmap = 'hourglass').pack()
Button(root, text = 'right', compound = 'right', bitmap = 'info').pack()
Button(root, text = 'left', command = 'left', bitmap = 'question').pack()
Button(root, text = 'center', compound = 'center', bitmap = )
root.mainloop()