pmi_menu.py 文件源码

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

项目:Visualization 作者: nwrush 项目源码 文件源码
def __init__(self, parent):
        self._window = tk.Toplevel(master=parent.frame)
        self._window.title("PMI Graph Settings")

        self._parent = parent
        self._data = parent.data

        self._color_settings = ttk.LabelFrame(master=self._window, text="Colors")
        self._color_settings.pack()

        self._colors = []
        for index, relation in enumerate(self._data.relation_types):
            label = tk.Label(master=self._color_settings, text="{0} Color".format(relation))
            btn = tk.Button(master=self._color_settings, text="Get Color", command=self._get_color_button(index))
            label.grid(row=index, column=0, sticky="we")
            btn.grid(row=index, column=1)

            parent_color = self._parent._colors[index]
            self._colors.append([label, btn, parent_color]) # Use a better default here

        self._window.protocol("WM_DELETE_WINDOW", self.on_exit)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号