labeledseparator.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:pkinter 作者: DeflatedPickle 项目源码 文件源码
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)

##################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号