Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit59f83a0

Browse files
authored
Merge pull request#28174 from meeseeksmachine/auto-backport-of-pr-28169-on-v3.9.x
Backport PR#28169 on branch v3.9.x (Clarify public-ness of some ToolContainerBase APIs.)
2 parentsb238681 +8308d91 commit59f83a0

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

‎lib/matplotlib/backend_bases.py

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3395,11 +3395,17 @@ def trigger_tool(self, name):
33953395

33963396
defadd_toolitem(self,name,group,position,image,description,toggle):
33973397
"""
3398-
Add a toolitem to the container.
3398+
A hook to add a toolitem to the container.
33993399
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.
34013402
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
34033409
must be *exactly* ``self.trigger_tool(name)``.
34043410
34053411
Parameters
@@ -3425,7 +3431,16 @@ def add_toolitem(self, name, group, position, image, description, toggle):
34253431

34263432
deftoggle_toolitem(self,name,toggled):
34273433
"""
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).
34293444
34303445
Parameters
34313446
----------
@@ -3438,11 +3453,16 @@ def toggle_toolitem(self, name, toggled):
34383453

34393454
defremove_toolitem(self,name):
34403455
"""
3441-
Removea toolitem from the`ToolContainer`.
3456+
A hook to removea toolitem from thecontainer.
34423457
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`.
34443461
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`.
34463466
34473467
Parameters
34483468
----------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp