8000 Deprecate GDK and GTK backends · matplotlib/matplotlib@4e302b7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4e302b7

Browse files
committed
Deprecate GDK and GTK backends
1 parent 5cdaab1 commit 4e302b7

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/matplotlib/backends/backend_gdk.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def fn_name(): return sys._getframe(1).f_code.co_name
2626
from matplotlib._pylab_helpers import Gcf
2727
from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
2828
FigureManagerBase, FigureCanvasBase
29-
from matplotlib.cbook import is_string_like, restrict_dict
29+
from matplotlib.cbook import is_string_like, restrict_dict, warn_deprecated
3030
from matplotlib.figure import Figure
3131
from matplotlib.mathtext import MathTextParser
3232
from matplotlib.transforms import Affine2D
@@ -441,6 +441,12 @@ def _renderer_init(self):
441441
self._renderer = RendererGDK (gtk.DrawingArea(), self.figure.dpi)
442442

443443
def _render_figure(self, pixmap, width, height):
444+
if isinstance(self._renderer, RendererGDK):
445+
warn_deprecated('2.0', message="The GDK backend is "
446+
"deprecated. It is untested, known to be "
447+
"broken and will be removed in Matplotlib 2.2. "
448+
"Use the Agg backend instead.",
449+
alternative="Agg")
444450
self._renderer.set_pixmap (pixmap)
445451
self._renderer.set_width_height (width, height)
446452
self.figure.draw (self._renderer)

lib/matplotlib/backends/backend_gtk.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def fn_name(): return sys._getframe(1).f_code.co_name
3737
from matplotlib.cbook import is_string_like, is_writable_file_like
3838
from matplotlib.figure import Figure
3939
from matplotlib.widgets import SubplotTool
40+
from matplotlib.cbook import warn_deprecated
4041

4142
from matplotlib import (
4243
cbook, colors as mcolors, lines, markers, rcParams, verbose)
@@ -418,6 +419,12 @@ def _pixmap_prepare(self, width, height):
418419
def _render_figure(self, pixmap, width, height):
419420
"""used by GTK and GTKcairo. GTKAgg overrides
420421
"""
422+
if isinstance(self._renderer, RendererGDK):
423+
warn_deprecated('2.0', message="The GTK backend is "
424+
"deprecated. It is untested, known to be "
425+
"broken and will be removed in Matplotlib 2.2. "
426+
"Use the GTKAgg backend instead.",
427+
alternative="GTKAgg")
421428
self._renderer.set_width_height (width, height)
422429
self.figure.draw (self._renderer)
423430

0 commit comments

Comments
 (0)
0