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)
评论列表
文章目录