本文整理汇总了Python中dialogs.Dialog.body方法的典型用法代码示例。如果您正苦于以下问题:Python Dialog.body方法的具体用法?Python Dialog.body怎么用?Python Dialog.body使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dialogs.Dialog
的用法示例。
在下文中一共展示了Dialog.body方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: body
# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import body [as 别名]
def body(self, master):
if not self.Fieldvars:
logger.debug("Creating username and password tk StringVars Fieldvars. Initial username is: %s", self.Initial_username)
# Notice: you should specify the variables' master; otherwise, if you instantiate
# multiple tk.Tk() instances during e.g. testing, these will
# mess up the variable logic (apparently...)
self.Fieldvars = OrderedDict(
username = [tk.StringVar(self.parent, value=self.Initial_username), 'Username', dict()],
password = [tk.StringVar(self.parent), 'Password', dict(show="*")]
)
# Call to super:
Dialog.body(self, master)
logger.debug("login prompt created, self.Fieldvars is: %s, with values: %s",
self.Fieldvars,
"; ".join(u"{}: {}".format(k, bool(v[0].get())) for k, v in self.Fieldvars.items()))
logger.debug("self.EntryWidgets have values: %s",
"; ".join(u"{}: {}".format(k, bool(v.get())) for k, v in self.EntryWidgets.items()))