(self, name, group, position, image_file, description,
toggle)
| 416 | self._toolitems = {} |
| 417 | |
| 418 | def add_toolitem(self, name, group, position, image_file, description, |
| 419 | toggle): |
| 420 | if toggle: |
| 421 | button = Gtk.ToggleToolButton() |
| 422 | else: |
| 423 | button = Gtk.ToolButton() |
| 424 | button.set_label(name) |
| 425 | |
| 426 | if image_file is not None: |
| 427 | image = Gtk.Image.new_from_gicon( |
| 428 | Gio.Icon.new_for_string(image_file), |
| 429 | Gtk.IconSize.LARGE_TOOLBAR) |
| 430 | button.set_icon_widget(image) |
| 431 | |
| 432 | if position is None: |
| 433 | position = -1 |
| 434 | |
| 435 | self._add_button(button, group, position) |
| 436 | signal = button.connect('clicked', self._call_tool, name) |
| 437 | button.set_tooltip_text(description) |
| 438 | button.show_all() |
| 439 | self._toolitems.setdefault(name, []) |
| 440 | self._toolitems[name].append((button, signal)) |
| 441 | |
| 442 | def _add_button(self, button, group, position): |
| 443 | if group not in self._groups: |
nothing calls this directly
no test coverage detected