diff --git a/doc/api/next_api_changes/deprecations/19019-AL.rst b/doc/api/next_api_changes/deprecations/19019-AL.rst new file mode 100644 index 000000000000..847c8770a676 --- /dev/null +++ b/doc/api/next_api_changes/deprecations/19019-AL.rst @@ -0,0 +1,5 @@ +*resize_callback* parameter to ``FigureCanvasTk`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +This parameter was never used internally and is deprecated. Tk-level custom +event handlers for resize events can be added to a ``FigureCanvasTk`` using +e.g. ``get_tk_widget().bind('', ..., True)``. diff --git a/lib/matplotlib/backends/_backend_tk.py b/lib/matplotlib/backends/_backend_tk.py index 072acda3e2d6..59426804943a 100644 --- a/lib/matplotlib/backends/_backend_tk.py +++ b/lib/matplotlib/backends/_backend_tk.py @@ -159,6 +159,9 @@ def _on_timer(self): class FigureCanvasTk(FigureCanvasBase): required_interactive_framework = "tk" + @cbook._delete_parameter( + "3.4", "resize_callback", + alternative="get_tk_widget().bind('', ..., True)") def __init__(self, figure, master=None, resize_callback=None): super().__init__(figure) self._idle = True