Python tkinter编程之Button_3

# -*-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()
发布了33 篇原创文章 · 获赞 5 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qiukapi/article/details/104032581