@@ -3395,11 +3395,17 @@ def trigger_tool(self, name):
3395
3395
3396
3396
def add_toolitem (self , name , group , position , image , description , toggle ):
3397
3397
"""
3398
- Add a toolitem to the container.
3398
+ A hook to add a toolitem to the container.
3399
3399
3400
- This method must be implemented per backend.
3400
+ This hook must be implemented in each backend and contains the
3401
+ backend-specific code to add an element to the toolbar.
3401
3402
3402
- The callback associated with the button click event,
3403
+ .. warning::
3404
+ This is part of the backend implementation and should
3405
+ not be called by end-users. They should instead call
3406
+ `.ToolContainerBase.add_tool`.
3407
+
3408
+ The callback associated with the button click event
3403
3409
must be *exactly* ``self.trigger_tool(name)``.
3404
3410
3405
3411
Parameters
@@ -3425,7 +3431,16 @@ def add_toolitem(self, name, group, position, image, description, toggle):
3425
3431
3426
3432
def toggle_toolitem (self , name , toggled ):
3427
3433
"""
3428
- Toggle the toolitem without firing event.
3434
+ A hook to toggle a toolitem without firing an event.
3435
+
3436
+ This hook must be implemented in each backend and contains the
3437
+ backend-specific code to silently toggle a toolbar element.
3438
+
3439
+ .. warning::
3440
+ This is part of the backend implementation and should
3441
+ not be called by end-users. They should instead call
3442
+ `.ToolManager.trigger_tool` or `.ToolContainerBase.trigger_tool`
3443
+ (which are equivalent).
3429
3444
3430
3445
Parameters
3431
3446
----------
@@ -3438,11 +3453,16 @@ def toggle_toolitem(self, name, toggled):
3438
3453
3439
3454
def remove_toolitem (self , name ):
3440
3455
"""
3441
- Remove a toolitem from the `ToolContainer` .
3456
+ A hook to remove a toolitem from the container .
3442
3457
3443
- This method must get implemented per backend.
3458
+ This hook must be implemented in each backend and contains the
3459
+ backend-specific code to remove an element from the toolbar; it is
3460
+ called when `.ToolManager` emits a `tool_removed_event`.
3444
3461
3445
- Called when `.ToolManager` emits a `tool_removed_event`.
3462
+ .. warning::
3463
+ This is part of the backend implementation and should
3464
+ not be called by end-users. They should instead call
3465
+ `.ToolManager.remove_tool`.
3446
3466
3447
3467
Parameters
3448
3468
----------
0 commit comments