def draw(self) -> None: self.columnconfigure(0, weight=1) image = self.app.get_icon(ImageEnum.DELETE, 16) button = ttk.Button(self, image=image, width=2, command=self.click_clear) button.image = image button.grid(sticky=tk.EW, pady=self.PAD) Tooltip(button, "Delete Marker") sizes = [1, 3, 8, 10] self.size.set(sizes[0]) sizes = ttk.Combobox(self, state="readonly", textvariable=self.size, value=sizes, width=2) sizes.grid(sticky=tk.EW, pady=self.PAD) Tooltip(sizes, "Marker Size") frame_size = TOOLBAR_SIZE self.color_frame = tk.Frame(self, background=self.color, height=frame_size, width=frame_size) self.color_frame.grid(sticky=tk.EW) self.color_frame.bind("<Button-1>", self.click_color) Tooltip(self.color_frame, "Marker Color")
def create_node_button(self): """ Create network layer button """ image = icon(ImageEnum.ROUTER) self.node_button = ttk.Button(self.design_frame, image=image, command=self.draw_node_picker) self.node_button.image = image self.node_button.grid(sticky="ew") Tooltip(self.node_button, "Network-layer virtual nodes")
def create_button( self, image_enum: ImageEnum, func: Callable, tooltip: str, radio: bool = False ) -> ttk.Button: image = self.app.get_icon(image_enum, TOOLBAR_SIZE) button = ttk.Button(self, image=image, command=func) button.image = image button.grid(sticky="ew") Tooltip(button, tooltip) if radio: self.radio_buttons.append(button) return button
def create_button( self, frame: ttk.Frame, image: "ImageTk.PhotoImage", func: Callable, tooltip: str, ): button = ttk.Button(frame, image=image, command=func) button.image = image button.grid(sticky="ew") Tooltip(button, tooltip) return button
def create_annotation_button(self): """ Create marker button and options that represent different marker types """ image = icon(ImageEnum.MARKER) self.annotation_button = ttk.Button( self.design_frame, image=image, command=self.draw_annotation_picker) self.annotation_button.image = image self.annotation_button.grid(sticky="ew") Tooltip(self.annotation_button, "background annotation tools")
def create_network_button(self): """ Create link-layer node button and the options that represent different link-layer node types. """ image = icon(ImageEnum.HUB) self.network_button = ttk.Button(self.design_frame, image=image, command=self.draw_network_picker) self.network_button.image = image self.network_button.grid(sticky="ew") Tooltip(self.network_button, "link-layer nodes")
def create_button(self, frame, image, func, tooltip): button = ttk.Button(frame, image=image, command=func) button.image = image button.grid(sticky="ew") Tooltip(button, tooltip) return button