def _create_toolbar(self): self.toolbar = ttk.Frame(self) suite_button = ToolButton(self.toolbar, text="Suites", width=0, tooltip="Expand to show all suites", command=self._on_expand_suites) test_button = ToolButton(self.toolbar, text="Test Cases", width=0, tooltip="Expand to show all suites and test cases", command=self._on_expand_tests) kw_button = ToolButton(self.toolbar, text="Test Keywords", width=0, tooltip="Expand to show all suites, test cases, and their keywords", command=self._on_expand_test_keywords) all_button = ToolButton(self.toolbar, text="Expand All Keywords", width=0, tooltip="Expand to show all suites, test cases, and keywords", command=self._on_expand_all) # this is just for experimentation; I don't really plan to have this on the toolbar next_fail = ToolButton(self.toolbar, text="Next Failure", width=0, tooltip="Go to next failed keyword", command=self._on_next_fail) prev_fail = ToolButton(self.toolbar, text="Previous Failure", width=0, tooltip="Go to previous failed keyword", command=self._on_previous_fail) suite_button.pack(side="left") test_button.pack(side="left") kw_button.pack(side="left") all_button.pack(side="left") ttk.Separator(self.toolbar, orient="vertical").pack(side="left", padx=4, pady=2, fill="y") next_fail.pack(side="left") prev_fail.pack(side="left")
def _create_command_line(self): self.command_frame = tk.Frame(self, borderwidth=2, relief="groove") self.command_expander = ToolButton(self.command_frame, imagedata=None, text=">", width=1, command=self._toggle_command) self.command_label = ttk.Label(self.command_frame, text="Command Line", anchor="w") self.command_text = tk.Text(self.command_frame, wrap="word", height=3) self.command_expander.grid(row=0, column=0) self.command_label.grid(row=0, column=1, sticky="w") self.command_text.grid(row=1, column=0, columnspan=2, sticky="nsew") self.command_frame.pack(side="top", fill="x") self.command_frame.grid_columnconfigure(1, weight=1) self._toggle_command(collapse=True)
def __init__(self, parent, title=">>>"): ttk.Frame.__init__(self, parent) self.trigger = ToolButton(self, text=title, width=0, tooltip="show command window", command=self.toggle) self.trigger.grid(row=0, column=0, sticky="nw") self.text = tk.Text(self, wrap="word", height=2, borderwidth=1, relief="solid") self.text.grid(row=1, column=0, columnspan=2, sticky="nsew", padx=4) self.grid_columnconfigure(1, weight=1) self.show(True)