本文整理匯總了Python中widgets.Widget.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python Widget.__init__方法的具體用法?Python Widget.__init__怎麽用?Python Widget.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類widgets.Widget
的用法示例。
在下文中一共展示了Widget.__init__方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from widgets import Widget [as 別名]
# 或者: from widgets.Widget import __init__ [as 別名]
def __init__(self, content=None, is_expandable=False, anchor=ANCHOR_CENTER, offset=(0, 0)):
"""
Creates a new Wrapper around an included Widget.
@param content The Widget to be wrapped.
"""
Widget.__init__(self)
self.content = content
self.expandable = is_expandable
self.anchor = anchor
self.content_offset = offset
示例2: __init__
# 需要導入模塊: from widgets import Widget [as 別名]
# 或者: from widgets.Widget import __init__ [as 別名]
def __init__(self, content=[], align=HALIGN_CENTER, padding=5):
"""
Creates a new VerticalLayout.
@param content A list of Widgets to be arranged
@param align HALIGN_LEFT if Widgets are to be left-justified,
HALIGN_CENTER if they should be centered, and
HALIGN_RIGHT if they are to be right-justified.
@param padding This amount of padding is inserted between widgets.
"""
assert isinstance(content, list) or isinstance(content, tuple)
Widget.__init__(self)
self.align = align
self.padding = padding
self.content = [x or Spacer() for x in content]
self.expandable = []