@@ -3388,11 +3388,17 @@ def trigger_tool(self, name):
3388
3388
3389
3389
def add_toolitem (self , name , group , position , image , description , toggle ):
3390
3390
"""
3391
- Add a toolitem to the container.
3391
+ A hook to add a toolitem to the container.
3392
3392
3393
- This method must be implemented per backend.
3393
+ This hook must be implemented in each backend and contains the
3394
+ backend-specific code to add an element to the toolbar.
3394
3395
3395
- The callback associated with the button click event,
3396
+ .. warning::
3397
+ This is part of the backend implementation and should
3398
+ not be called by end-users. They should instead call
3399
+ `.ToolContainerBase.add_tool`.
3400
+
3401
+ The callback associated with the button click event
3396
3402
must be *exactly* ``self.trigger_tool(name)``.
3397
3403
3398
3404
Parameters
@@ -3418,7 +3424,16 @@ def add_toolitem(self, name, group, position, image, description, toggle):
3418
3424
3419
3425
def toggle_toolitem (self , name , toggled ):
3420
3426
"""
3421
- Toggle the toolitem without firing event.
3427
+ A hook to toggle a toolitem without firing an event.
3428
+
3429
+ This hook must be implemented in each backend and contains the
3430
+ backend-specific code to silently toggle a toolbar element.
3431
+
3432
+ .. warning::
3433
+ This is part of the backend implementation and should
3434
+ not be called by end-users. They should instead call
3435
+ `.ToolManager.trigger_tool` or `.ToolContainerBase.trigger_tool`
3436
+ (which are equivalent).
3422
3437
3423
3438
Parameters
3424
3439
----------
@@ -3431,11 +3446,16 @@ def toggle_toolitem(self, name, toggled):
3431
3446
3432
3447
def remove_toolitem (self , name ):
3433
3448
"""
3434
- Remove a toolitem from the `ToolContainer` .
3449
+ A hook to remove a toolitem from the container .
3435
3450
3436
- This method must get implemented per backend.
3451
+ This hook must be implemented in each backend and contains the
3452
+ backend-specific code to remove an element from the toolbar; it is
3453
+ called when `.ToolManager` emits a `tool_removed_event`.
3437
3454
3438
- Called when `.ToolManager` emits a `tool_removed_event`.
3455
+ .. warning::
3456
+ This is part of the backend implementation and should
3457
+ not be called by end-users. They should instead call
3458
+ `.ToolManager.remove_tool`.
3439
3459
3440
3460
Parameters
3441
3461
----------
0 commit comments