diff --git a/examples/user_interfaces/embedding_in_wx3_sgskip.py b/examples/user_interfaces/embedding_in_wx3_sgskip.py index 9368b2917438..c1aca8b6d144 100644 --- a/examples/user_interfaces/embedding_in_wx3_sgskip.py +++ b/examples/user_interfaces/embedding_in_wx3_sgskip.py @@ -99,10 +99,6 @@ def OnWhiz(self, evt): self.canvas.draw() - def onEraseBackground(self, evt): - # this is supposed to prevent redraw flicker on some X servers... - pass - class MyApp(wx.App): def OnInit(self): diff --git a/lib/matplotlib/backends/backend_qt5.py b/lib/matplotlib/backends/backend_qt5.py index 6d4546644aa3..e3ac5467508e 100644 --- a/lib/matplotlib/backends/backend_qt5.py +++ b/lib/matplotlib/backends/backend_qt5.py @@ -233,20 +233,12 @@ def _update_figure_dpi(self): @_allow_super_init def __init__(self, figure): _create_qApp() - figure._original_dpi = figure.dpi - super(FigureCanvasQT, self).__init__(figure=figure) + figure._original_dpi = figure.dpi self.figure = figure self._update_figure_dpi() - - w, h = self.get_width_height() - self.resize(w, h) - - self.setMouseTracking(True) - # Key auto-repeat enabled by default - self._keyautorepeat = True - + self.resize(*self.get_width_height()) # In cases with mixed resolution displays, we need to be careful if the # dpi_ratio changes - in this case we need to resize the canvas # accordingly. We could watch for screenChanged events from Qt, but @@ -256,6 +248,13 @@ def __init__(self, figure): # needed. self._dpi_ratio_prev = None + self.setMouseTracking(True) + # Key auto-repeat enabled by default + self._keyautorepeat = True + + palette = QtGui.QPalette(QtCore.Qt.white) + self.setPalette(palette) + @property def _dpi_ratio(self): # Not available on Qt4 or some older Qt5. diff --git a/lib/matplotlib/backends/backend_tkagg.py b/lib/matplotlib/backends/backend_tkagg.py index 70b06274c00d..58d171f0d737 100644 --- a/lib/matplotlib/backends/backend_tkagg.py +++ b/lib/matplotlib/backends/backend_tkagg.py @@ -176,8 +176,8 @@ def __init__(self, figure, master=None, resize_callback=None): t1,t2,w,h = self.figure.bbox.bounds w, h = int(w), int(h) self._tkcanvas = Tk.Canvas( - master=master, width=w, height=h, borderwidth=0, - highlightthickness=0) + master=master, background="white", + width=w, height=h, borderwidth=0, highlightthickness=0) self._tkphoto = Tk.PhotoImage( master=self._tkcanvas, width=w, height=h) self._tkcanvas.create_image(w//2, h//2, image=self._tkphoto) @@ -661,7 +661,6 @@ class NavigationToolbar2TkAgg(NavigationToolbar2, Tk.Frame): def __init__(self, canvas, window): self.canvas = canvas self.window = window - self._idle = True NavigationToolbar2.__init__(self, canvas) def destroy(self, *args): diff --git a/lib/matplotlib/backends/backend_wx.py b/lib/matplotlib/backends/backend_wx.py index 49ba3e87f9f2..7be2117f483e 100644 --- a/lib/matplotlib/backends/backend_wx.py +++ b/lib/matplotlib/backends/backend_wx.py @@ -684,8 +684,8 @@ def do_nothing(*args, **kwargs): self.Bind(wx.EVT_MOUSE_CAPTURE_CHANGED, self._onCaptureLost) self.Bind(wx.EVT_MOUSE_CAPTURE_LOST, self._onCaptureLost) - # Reduce flicker. - self.SetBackgroundStyle(wx.BG_STYLE_PAINT) + self.SetBackgroundStyle(wx.BG_STYLE_PAINT) # Reduce flicker. + self.SetBackgroundColour(wx.WHITE) self.macros = {} # dict from wx id to seq of macros @@ -941,13 +941,6 @@ def _onPaint(self, evt): self.gui_repaint(drawDC=drawDC) evt.Skip() - def _onEraseBackground(self, evt): - """ - Called when window is redrawn; since we are blitting the entire - image, we can leave this blank to suppress flicker. - """ - pass - def _onSize(self, evt): """ Called when wxEventSize is generated. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy