def __init__(self, parent, text="", orient="horizontal", text_align="", padding=5, *args):
ttk.Frame.__init__(self, parent, *args)
self.parent = parent
self._text = text
self._orient = orient
self._text_align = text_align
self._padding = padding
self._separator = ttk.Separator(self, orient=self._orient)
self._label = ttk.Label(self, text=self._text)
if self._orient == "horizontal":
self.grid_columnconfigure(0, weight=1)
self._separator.grid(row=0, column=0, sticky="we")
self._label.grid(row=0, column=0, sticky=self._text_align, padx=self._padding)
elif self._orient == "vertical":
self.grid_rowconfigure(0, weight=1)
self._separator.grid(row=0, column=0, sticky="ns")
self._label.grid(row=0, column=0, sticky=self._text_align, pady=self._padding)
##################################################
评论列表
文章目录