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

Skip to content

Commit 09a9df7

Browse 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 09a9df7

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
Lines 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

Lines 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)