本文整理汇总了Python中Tkinter.LabelFrame.winfo_children方法的典型用法代码示例。如果您正苦于以下问题:Python LabelFrame.winfo_children方法的具体用法?Python LabelFrame.winfo_children怎么用?Python LabelFrame.winfo_children使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tkinter.LabelFrame
的用法示例。
在下文中一共展示了LabelFrame.winfo_children方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _init_components
# 需要导入模块: from Tkinter import LabelFrame [as 别名]
# 或者: from Tkinter.LabelFrame import winfo_children [as 别名]
def _init_components(self):
# group type selection (alternating, classical, sporadic, exceptional)
group_type_frame = LabelFrame(self, text="Group type")
group_type_frame.pack(expand=True, fill="x", padx=10, pady=5)
# group type radio buttons (Alternating, Classical etc.)
self._group_type = StringVar()
self._type_radio_buttons = dict()
for type in ("Alternating", "Classical", "Exceptional", "Sporadic"):
self._type_radio_buttons[type] = Radiobutton(
group_type_frame, variable=self._group_type, value=type, text=type
)
self._type_radio_buttons[type].pack(anchor="nw", padx=10)
# set group type selection handler
self._group_type.trace("w", lambda n, i, m: self._group_type_selection())
# parameters for each group (degree for alternating, field and
# dimension for classical etc.
group_params_frame = LabelFrame(self, text="Parameters")
group_params_frame.pack(expand=True, fill="x", padx=10, pady=5)
# alternating
self._alt_params = Frame(group_params_frame)
self._alt_params.columnconfigure(1, weight=1)
Label(self._alt_params, text="Degree").grid(sticky="w")
self._alt_degree = NumberBox(self._alt_params, constraints=Constraints(min=5))
self._alt_degree.grid(row=0, column=1, sticky="we")
# classical
self._clas_params = Frame(group_params_frame)
self._clas_params.columnconfigure(1, weight=1)
Label(self._clas_params, text="Type").grid(row=0, sticky="w")
self._clas_type = OptionList(self._clas_params, values=ClassicalGroup.types())
self._clas_type.variable.trace("w", lambda n, i, m: self._classical_group_type_selection())
self._clas_type.grid(row=0, column=1, sticky="we")
Label(self._clas_params, text="Dimension").grid(row=1, sticky="w")
self._clas_dim = NumberBox(self._clas_params)
self._clas_dim.grid(row=1, column=1, sticky="we")
Label(self._clas_params, text="Field order").grid(row=2, sticky="w")
self._clas_field = NumberBox(self._clas_params, constraints=Constraints(primality=numeric.PRIME_POWER))
self._clas_field.grid(row=2, column=1, sticky="we")
self._classical_group_type_selection()
# exceptional
self._ex_params = Frame(group_params_frame)
self._ex_params.columnconfigure(1, weight=1)
Label(self._ex_params, text="Type").grid(row=0, sticky="w")
self._ex_type = OptionList(self._ex_params, values=ExceptionalGroup.types())
self._ex_type.setvar(value=ExceptionalGroup.types()[0])
self._ex_type.grid(row=0, column=1, sticky="we")
Label(self._ex_params, text="Field order").grid(row=1, sticky="w")
self._ex_field = NumberBox(self._ex_params, constraints=Constraints(primality=numeric.PRIME_POWER))
self._ex_field.grid(row=1, column=1, sticky="we")
# sporadic
self._spor_params = Frame(group_params_frame)
self._spor_params.columnconfigure(1, weight=1)
Label(self._spor_params, text="Group").grid(row=0, sticky="w")
self._sporadic_group = OptionList(self._spor_params, values=SporadicGroup.all_groups())
self._sporadic_group.grid(row=0, column=1, sticky="we")
# pack params frames
for child_frame in group_params_frame.winfo_children():
child_frame.pack(expand=True, fill="x", padx=10)