def __init__(self, parent, title="", title_command=None, info="", info_command=None, background="SystemButtonFace", *args):
ttk.Frame.__init__(self, parent, *args)
self.parent = parent
self._title = title
self._title_command = title_command
self._info = info
self._info_command = info_command
self._background = background
self.columnconfigure(1, weight=1)
style = ttk.Style()
style.configure("InfoBar.Toolbutton", background=self._background)
style.configure("InfoClose.InfoBar.Toolbutton", anchor="center")
if self._title != "":
self._title_button = ttk.Button(self, text=self._title, style="InfoBar.Toolbutton", command=self._title_command)
self._title_button.grid(row=0, column=0)
self._info_button = ttk.Button(self, text=self._info, style="InfoBar.Toolbutton", command=self._info_command)
self._info_button.grid(row=0, column=1, sticky="we")
self._close_button = ttk.Button(self, text="x", width=2, style="InfoClose.InfoBar.Toolbutton", command=self.close)
self._close_button.grid(row=0, column=2)
评论列表
文章目录