本文整理汇总了Python中tkinter.Button.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Button.__init__方法的具体用法?Python Button.__init__怎么用?Python Button.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkinter.Button
的用法示例。
在下文中一共展示了Button.__init__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from tkinter import Button [as 别名]
# 或者: from tkinter.Button import __init__ [as 别名]
def __init__(self, **kwargs):
"""
Constructor
root - reference to the wdiget containing this widget
"""
Button.__init__(self, **kwargs)
self["text"] = "Start/Stop"
示例2: __init__
# 需要导入模块: from tkinter import Button [as 别名]
# 或者: from tkinter.Button import __init__ [as 别名]
def __init__(self, master=None, x=0, y=0, colour=None):
Button.__init__(self, master, relief="flat", fg = "#444", font = ("Ariel", 10),
bd=0, command=self.command)
self.x, self.y = x, y
self.select=False
if colour: self.pile = [colour]
else: self.pile = []
self.colourize()
self.pile_size_display()
示例3: __init__
# 需要导入模块: from tkinter import Button [as 别名]
# 或者: from tkinter.Button import __init__ [as 别名]
def __init__(self, master=None, cnf={}, **kw):
Button.__init__(self, master, cnf, **kw)
self.config(
compound=TkC.TOP,
relief=TkC.FLAT,
bd=0,
bg="#b91d47", # dark-red
fg="white",
activebackground="#b91d47", # dark-red
activeforeground="white",
highlightthickness=0,
font=("Droid Sans Mono", "16")
)
示例4: __init__
# 需要导入模块: from tkinter import Button [as 别名]
# 或者: from tkinter.Button import __init__ [as 别名]
def __init__(self, master, command, file_name):
Button.__init__(self, master, bg="SkyBlue4", command=command, activebackground="midnight blue", border=5)
image = PhotoImage(file=file_name).subsample(x=4, y=4)
self.configure(image=image)
self.image = image
示例5: __init__
# 需要导入模块: from tkinter import Button [as 别名]
# 或者: from tkinter.Button import __init__ [as 别名]
def __init__(self, *args, **kwargs):
Button.__init__(self, *args, **kwargs)
self.__configure()