A hook to add a toolitem to the container. This hook must be implemented in each backend and contains the backend-specific code to add an element to the toolbar. .. warning:: This is part of the backend implementation and should not be calle
(self, name, group, position, image, description, toggle)
| 3529 | self.toolmanager.trigger_tool(name, sender=self) |
| 3530 | |
| 3531 | def add_toolitem(self, name, group, position, image, description, toggle): |
| 3532 | """ |
| 3533 | A hook to add a toolitem to the container. |
| 3534 | |
| 3535 | This hook must be implemented in each backend and contains the |
| 3536 | backend-specific code to add an element to the toolbar. |
| 3537 | |
| 3538 | .. warning:: |
| 3539 | This is part of the backend implementation and should |
| 3540 | not be called by end-users. They should instead call |
| 3541 | `.ToolContainerBase.add_tool`. |
| 3542 | |
| 3543 | The callback associated with the button click event |
| 3544 | must be *exactly* ``self.trigger_tool(name)``. |
| 3545 | |
| 3546 | Parameters |
| 3547 | ---------- |
| 3548 | name : str |
| 3549 | Name of the tool to add, this gets used as the tool's ID and as the |
| 3550 | default label of the buttons. |
| 3551 | group : str |
| 3552 | Name of the group that this tool belongs to. |
| 3553 | position : int |
| 3554 | Position of the tool within its group, if -1 it goes at the end. |
| 3555 | image : str |
| 3556 | Filename of the image for the button or `None`. |
| 3557 | description : str |
| 3558 | Description of the tool, used for the tooltips. |
| 3559 | toggle : bool |
| 3560 | * `True` : The button is a toggle (change the pressed/unpressed |
| 3561 | state between consecutive clicks). |
| 3562 | * `False` : The button is a normal button (returns to unpressed |
| 3563 | state after release). |
| 3564 | """ |
| 3565 | raise NotImplementedError |
| 3566 | |
| 3567 | def toggle_toolitem(self, name, toggled): |
| 3568 | """ |