dialog_elements.py 文件源码

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

项目:Enrich2 作者: FowlerLab 项目源码 文件源码
def body(self, master, row, columns=DEFAULT_COLUMNS, width=4, left=False,
             **kwargs):
        """
        Add the labeled entry to the Frame *master* using grid at *row*.

        *width* controls the width of the Entry.
        *left* is ``True`` if the Entry is to the left of the Label.
        *columns* is the number of columns in *master*.

        Returns the number of rows taken by this element.
        """
        if left:
            entry_column = 0
            entry_sticky = "e"
            entry_width = 1
            label_column = 1
            label_sticky = "w"
            label_width = columns - 1
        else:
            entry_column = 1
            entry_sticky = "w"
            entry_width = columns - 1
            label_column = 0
            label_sticky = "e"
            label_width = 1

        label = ttk.Label(master, text=self.text)
        label.grid(row=row, column=label_column, columnspan=label_width,
                   sticky=label_sticky)
        self.entry = ttk.Entry(master, textvariable=self.value, width=width)
        self.entry.grid(row=row, column=entry_column, columnspan=entry_width,
                        sticky=entry_sticky)
        return 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号