From f076d3784d102ff140a2c8a69adb0c9cdc114411 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Mon, 19 Oct 2020 10:42:44 +0200 Subject: [PATCH] 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. --- doc/api/next_api_changes/deprecations/19019-AL.rst | 5 +++++ lib/matplotlib/backends/_backend_tk.py | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 doc/api/next_api_changes/deprecations/19019-AL.rst 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