Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fd90881

Browse files
committed
Clarify public-ness of some ToolContainerBase APIs.
add_toolitem is clearly intended as a helper for add_tool (add_tool sets up a bunch of auxiliary arguments for it which the end-user should not bother with). toggle_toolitem and remove_toolitem also look internal-ish. Document them as such.
1 parent 63156f2 commit fd90881

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3413,6 +3413,12 @@ def add_toolitem(self, name, group, position, image, description, toggle):
34133413
state between consecutive clicks).
34143414
* `False` : The button is a normal button (returns to unpressed
34153415
state after release).
3416+
3417+
Note
3418+
----
3419+
This method is not intended to be called by end-users (who should
3420+
instead `.ToolContainerBase.add_tool`); it is provided to be
3421+
implemented by third-party backends.
34163422
"""
34173423
raise NotImplementedError
34183424

@@ -3426,6 +3432,13 @@ def toggle_toolitem(self, name, toggled):
34263432
Id of the tool to toggle.
34273433
toggled : bool
34283434
Whether to set this tool as toggled or not.
3435+
3436+
Note
3437+
----
3438+
This method is not intended to be called by end-users
3439+
(who should instead use `.ToolManager.trigger_tool` or
3440+
`.ToolContainerBase.trigger_tool`, which are equivalent); it is
3441+
provided to be implemented by third-party backends.
34293442
"""
34303443
raise NotImplementedError
34313444

@@ -3441,6 +3454,12 @@ def remove_toolitem(self, name):
34413454
----------
34423455
name : str
34433456
Name of the tool to remove.
3457+
3458+
Note
3459+
----
3460+
This method is not intended to be called by end-users (who should
3461+
instead use `.ToolManager.remove_tool`); it is provided to be
3462+
implemented by third-party backends.
34443463
"""
34453464
raise NotImplementedError
34463465

0 commit comments

Comments
 (0)