From d3c7e93f2143e31ed5ff80aa21c8d983df92d19f Mon Sep 17 00:00:00 2001 From: Balint Seeber Date: Fri, 18 Jan 2013 16:26:09 -0800 Subject: Removed check for pending events during mouse drag of GRC blocks on FlowGraph canvas. This is always true on Windows with latest PyGTK and so blocks would never move with mouse movement. Disabling the check appears to have no adverse effects. --- grc/gui/FlowGraph.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/grc/gui/FlowGraph.py b/grc/gui/FlowGraph.py index 67e5af97b..6af4bcb62 100644 --- a/grc/gui/FlowGraph.py +++ b/grc/gui/FlowGraph.py @@ -494,8 +494,9 @@ class FlowGraph(Element): Move a selected element to the new coordinate. Auto-scroll the scroll bars at the boundaries. """ - #to perform a movement, the mouse must be pressed, no pending events - if gtk.events_pending() or not self.mouse_pressed: return + #to perform a movement, the mouse must be pressed + # (no longer checking pending events via gtk.events_pending() - always true in Windows) + if not self.mouse_pressed: return #perform autoscrolling width, height = self.get_size() x, y = coordinate -- cgit From 6b9b1f762eacd6ad53727cf116d12a76d6e8b6b8 Mon Sep 17 00:00:00 2001 From: Balint Seeber Date: Fri, 18 Jan 2013 16:28:10 -0800 Subject: Added PaintDC to 'plotter_base' so WX GL sinks will work under Windows. Changed 'notebook' SetSelection (deprecated) to ChangeSelection. --- gr-wxgui/src/python/forms/forms.py | 3 ++- gr-wxgui/src/python/plotter/plotter_base.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gr-wxgui/src/python/forms/forms.py b/gr-wxgui/src/python/forms/forms.py index f1d0038ab..cabc5860b 100644 --- a/gr-wxgui/src/python/forms/forms.py +++ b/gr-wxgui/src/python/forms/forms.py @@ -500,7 +500,8 @@ class notebook(_chooser_base): self._add_widget(self._notebook) def _handle(self, event): self[INT_KEY] = self._notebook.GetSelection() - def _update(self, i): self._notebook.SetSelection(i) + # SetSelection triggers a page change event (deprecated, breaks on Windows) and ChangeSelection does not + def _update(self, i): self._notebook.ChangeSelection(i) # ---------------------------------------------------------------- # Stand-alone test application diff --git a/gr-wxgui/src/python/plotter/plotter_base.py b/gr-wxgui/src/python/plotter/plotter_base.py index 41c94e5e0..f1cbaf3c7 100644 --- a/gr-wxgui/src/python/plotter/plotter_base.py +++ b/gr-wxgui/src/python/plotter/plotter_base.py @@ -151,6 +151,8 @@ class plotter_base(wx.glcanvas.GLCanvas, common.mutex): Resize the view port if the width or height changed. Redraw the screen, calling the draw functions. """ + # create device context (needed on Windows, noop on X) + dc = wx.PaintDC(self) self.lock() self.SetCurrent() -- cgit