本文整理汇总了Python中dialogs.Dialog.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Dialog.__init__方法的具体用法?Python Dialog.__init__怎么用?Python Dialog.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dialogs.Dialog
的用法示例。
在下文中一共展示了Dialog.__init__方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import __init__ [as 别名]
def __init__(self, title, items, **kwds):
self.title = title
self.items = items
self._items = [MenuItem(*item) for item in items]
Dialog.__init__(self, **kwds)
h = self.font.get_linesize()
self.height = h * len(self._items) + h
示例2: __init__
# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import __init__ [as 别名]
def __init__(self, title, responses, default=None, ok_action=None):
self.response = responses[0]
self.ok_action = ok_action
title = Label(title)
self.w_type = ChoiceButton(responses)
col = Column([title, self.w_type, Row([Button("OK", action=ok_action or self.dismiss_ok), Button("Cancel", action=ok_action or self.dismiss)], margin=0)], margin=0, spacing=2)
Dialog.__init__(self, client=col)
示例3: __init__
# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import __init__ [as 别名]
def __init__(self, title, items, scrolling=False, scroll_items=30,
scroll_page=5, handler=None, **kwds):
self.handler = handler
self.title = _(title, doNotTranslate=kwds.get('doNotTranslate', False))
self.items = items
self._items = [MenuItem(*item, doNotTranslate=kwds.get('doNotTranslate', False)) for item in items]
self.scrolling = scrolling and len(self._items) > scroll_items
self.scroll_items = scroll_items
self.scroll_page = scroll_page
Dialog.__init__(self, **kwds)
self.root = self.get_root()
self.calc_size()
示例4: __init__
# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import __init__ [as 别名]
def __init__(self, title, items, scrolling=False, scroll_items=30,
scroll_page=5, **kwds):
self.title = _(title)
self.items = items
self._items = [MenuItem(*item) for item in items]
self.scrolling = scrolling and len(self._items) > scroll_items
self.scroll_items = scroll_items
self.scroll_page = scroll_page
Dialog.__init__(self, **kwds)
h = self.font.get_linesize()
if self.scrolling:
self.height = h * self.scroll_items + h
else:
self.height = h * len(self._items) + h
示例5: __init__
# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import __init__ [as 别名]
def __init__(self, parent, title = None, fieldvars = None, username='', msg=None):
self.Initial_username = username # super's __init__ calls body, which depends on this.
Dialog.__init__(self, parent, title, fieldvars, msg=msg)
示例6: __init__
# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import __init__ [as 别名]
def __init__(self, title, items, **kwds):
self.title = title
self.items = items
self._items = [MenuItem(*item) for item in items]
Dialog.__init__(self, **kwds)