本文整理汇总了Python中Button.Button.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Button.__init__方法的具体用法?Python Button.__init__怎么用?Python Button.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Button.Button
的用法示例。
在下文中一共展示了Button.__init__方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Button import Button [as 别名]
# 或者: from Button.Button import __init__ [as 别名]
def __init__(self, x, y, text, parent, c=(255,0,0)):
Button.__init__(self, x, y, text, parent, c)
self.font = pygame.font.SysFont('Calibri', 12)
self.width -= 10
self.height = 20
self.surface = pygame.Surface((self.width, self.height))
self.render()
示例2: __init__
# 需要导入模块: from Button import Button [as 别名]
# 或者: from Button.Button import __init__ [as 别名]
def __init__ (self, text):
Button.__init__ (self, text)
# Internal click handler
self.__click = False
self._active = False
# The ToggleButton emits a 'toggled' event.
self._signals[SIG_TOGGLED] = []
示例3: __init__
# 需要导入模块: from Button import Button [as 别名]
# 或者: from Button.Button import __init__ [as 别名]
def __init__ (self, caption, _props={}):
# Properties
props = _props.copy()
if 'class' in props:
props['class'] += ' druid-button'
else:
props['class'] = 'druid-button'
# Parent's constructor
Button.__init__ (self, caption, props)
示例4: __init__
# 需要导入模块: from Button import Button [as 别名]
# 或者: from Button.Button import __init__ [as 别名]
def __init__(self, parent, **kwargs):
Button.__init__(self, parent)
# data
self.direction = ALIGN_N
# del
del self.text
del self.icons
# flags
self.processKWArguments(kwargs)
parent.registerWidget(self)
示例5: __init__
# 需要导入模块: from Button import Button [as 别名]
# 或者: from Button.Button import __init__ [as 别名]
def __init__(self, pX, pY, pText, pColor=BLACK, pFontSize=36, pMethod=None, pName=None, pParams=None):
'''
Constructor
'''
if pName == None:
name = pText
else:
name = pName
Button.__init__(self, pX, pY, pName=name, pMethod=pMethod, pParams=pParams)
font = pygame.font.Font(None, pFontSize)
self.text = font.render(pText, 1, (pColor))
示例6: __init__
# 需要导入模块: from Button import Button [as 别名]
# 或者: from Button.Button import __init__ [as 别名]
def __init__(self, text=' ', x=None, y=None, width=35, height=35,
bg_color=None, fg_color=None, selected_bg_color=None,
selected_fg_color=None):
self.upper_case = True
self.max_width = width
Button.__init__(self, text, None, x, y, width, height, bg_color,
fg_color, selected_bg_color, selected_fg_color, border=None)
self.h_margin = 0
self.v_margin = 0
self.h_spacing = 0
self.v_spacing = 0
self.set_v_align(Align.BOTTOM)
self.set_h_align(Align.CENTER)
self.label.set_v_align(Align.CENTER)
self.label.set_h_align(Align.CENTER)
for c in copy.copy(self.children):
if isinstance(c, Border):
self.children.remove(c)
self.border = -1
示例7: __init__
# 需要导入模块: from Button import Button [as 别名]
# 或者: from Button.Button import __init__ [as 别名]
def __init__(self, component):
Button.__init__(self, component)
self.buttonStyle = Button.CHECKBOX_STYLE
示例8: __init__
# 需要导入模块: from Button import Button [as 别名]
# 或者: from Button.Button import __init__ [as 别名]
def __init__ (self, caption="Submit"):
Button.__init__ (self, caption)
示例9: __init__
# 需要导入模块: from Button import Button [as 别名]
# 或者: from Button.Button import __init__ [as 别名]
def __init__ (self, image):
Button.__init__ (self, "")
self._picture = None
self._path = None
self.set_picture (image)
示例10: __init__
# 需要导入模块: from Button import Button [as 别名]
# 或者: from Button.Button import __init__ [as 别名]
def __init__(self, parent, **kwargs):
Button.__init__(self, parent)
# data
# flags
self.processKWArguments(kwargs)
parent.registerWidget(self)
示例11: __init__
# 需要导入模块: from Button import Button [as 别名]
# 或者: from Button.Button import __init__ [as 别名]
def __init__(self, texture):
Button.__init__(self, texture)
示例12: __init__
# 需要导入模块: from Button import Button [as 别名]
# 或者: from Button.Button import __init__ [as 别名]
def __init__(self, parent=None, name=None):
Button.__init__(self, parent, name)
self.setFixedSize(ITEM_SIZE)