# HG changeset patch # User Andrey Skvortsov # Date 1550127778 -10800 # Node ID 9c5f835b031e537d5a762900449973f64a30f977 # Parent 9076249f11eb969990c728ab477f9f9e3c0f8ecf Fix redraw problems in preview frames and debug panel The problem was that direct call of RefreshView (now DrawView) doesn't generate EVT_PAINT (at least on GNU/Linux with Wayland and wxgtk build with gtk3+ support). Now RefreshView simply triggers EVT_PAINT and EVT_PAINT handler does actual work. diff -r 9076249f11eb -r 9c5f835b031e controls/DebugVariablePanel/DebugVariablePanel.py --- a/controls/DebugVariablePanel/DebugVariablePanel.py Thu Feb 14 09:44:19 2019 +0300 +++ b/controls/DebugVariablePanel/DebugVariablePanel.py Thu Feb 14 10:02:58 2019 +0300 @@ -521,6 +521,15 @@ self.RefreshGraphicsWindowScrollbars() def RefreshView(self): + """Triggers EVT_PAINT event to refresh UI""" + self.Refresh() + + def DrawView(self): + """ + Redraw elements. + Method is used by EVT_PAINT handler. + """ + self.RefreshCanvasPosition() if not self.Fixed or self.Force: @@ -922,7 +931,9 @@ pass def OnGraphicsWindowPaint(self, event): - self.RefreshView() + """EVT_PAINT handler""" + + self.DrawView() event.Skip() def OnGraphicsWindowResize(self, event): diff -r 9076249f11eb -r 9c5f835b031e controls/DebugVariablePanel/DebugVariableTextViewer.py --- a/controls/DebugVariablePanel/DebugVariableTextViewer.py Thu Feb 14 09:44:19 2019 +0300 +++ b/controls/DebugVariablePanel/DebugVariableTextViewer.py Thu Feb 14 10:02:58 2019 +0300 @@ -185,8 +185,12 @@ self.Buttons.append(GraphButton(0, 0, bitmap, callback)) def RefreshViewer(self): - """ - Method that refresh the content displayed by Viewer + """Triggers EVT_PAINT event to refresh UI""" + self.Refresh() + + def DrawViewer(self): + """ + Redraw content displayed by Viewer """ # Create buffered DC for drawing in panel width, height = self.GetSize() @@ -282,5 +286,5 @@ Function called when redrawing Viewer content is needed @param event: wx.PaintEvent """ - self.RefreshViewer() + self.DrawViewer() event.Skip() diff -r 9076249f11eb -r 9c5f835b031e dialogs/BlockPreviewDialog.py --- a/dialogs/BlockPreviewDialog.py Thu Feb 14 09:44:19 2019 +0300 +++ b/dialogs/BlockPreviewDialog.py Thu Feb 14 10:02:58 2019 +0300 @@ -251,6 +251,10 @@ self.EndModal(wx.ID_OK) def RefreshPreview(self): + """Triggers EVT_PAINT event to refresh UI""" + self.Refresh() + + def DrawPreview(self): """ Refresh preview panel of graphic element May be overridden by inherited classes @@ -300,5 +304,5 @@ Called when Preview panel need to be redraw @param event: wx.PaintEvent """ - self.RefreshPreview() + self.DrawPreview() event.Skip()