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

Appearance settings

Commit f076d37

Browse filesBrowse files
committed
Deprecate never used resize_callback param to FigureCanvasTk.
AFAICT this was present since all the way back in e34a333 but never actually used. The standard way of registering callbacks (either at the Tk level or at the Matplotlib level) seems good enough.
1 parent f50fe72 commit f076d37
Copy full SHA for f076d37

File tree

Expand file treeCollapse file tree

2 files changed

+8
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-0
lines changed
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*resize_callback* parameter to ``FigureCanvasTk``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
This parameter was never used internally and is deprecated. Tk-level custom
4+
event handlers for resize events can be added to a ``FigureCanvasTk`` using
5+
e.g. ``get_tk_widget().bind('<Configure>', ..., True)``.

‎lib/matplotlib/backends/_backend_tk.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/_backend_tk.py
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ def _on_timer(self):
159159
class FigureCanvasTk(FigureCanvasBase):
160160
required_interactive_framework = "tk"
161161

162+
@cbook._delete_parameter(
163+
"3.4", "resize_callback",
164+
alternative="get_tk_widget().bind('<Configure>', ..., True)")
162165
def __init__(self, figure, master=None, resize_callback=None):
163166
super().__init__(figure)
164167
self._idle = True

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.