commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 64/101: grc: gtk3: better lables/shapes han


From: git
Subject: [Commit-gnuradio] [gnuradio] 64/101: grc: gtk3: better lables/shapes handling during flowgraph update
Date: Thu, 16 Mar 2017 14:58:08 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch python3
in repository gnuradio.

commit 979cab9bf5d5986c3df3ea97d0082ed41d313190
Author: Sebastian Koslowski <address@hidden>
Date:   Mon Aug 1 17:27:09 2016 +0200

    grc: gtk3: better lables/shapes handling during flowgraph update
---
 grc/gui/Element.py   | 34 +++++++++++++++-------------------
 grc/gui/FlowGraph.py | 14 ++++++++++----
 2 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/grc/gui/Element.py b/grc/gui/Element.py
index 73be7b8..81a5cbf 100644
--- a/grc/gui/Element.py
+++ b/grc/gui/Element.py
@@ -76,25 +76,6 @@ class Element(object):
         rotation = rotation or self.rotation
         return rotation in (90, 270)
 
-    def create_labels(self):
-        """
-        Create labels (if applicable) and call on all children.
-        Call this base method before creating labels in the element.
-        """
-        for child in self.get_children():
-            child.create_labels()
-
-    def create_shapes(self):
-        """
-        Create shapes (if applicable) and call on all children.
-        Call this base method before creating shapes in the element.
-        """
-        for child in self.get_children():
-            child.create_shapes()
-
-    def draw(self, widget, cr):
-        raise NotImplementedError()
-
     def rotate(self, rotation):
         """
         Rotate all of the areas by 90 degrees.
@@ -115,6 +96,21 @@ class Element(object):
         dx, dy = delta_coor
         self.coordinate = (x + dx, y + dy)
 
+    def create_labels(self):
+        """
+        Create labels (if applicable) and call on all children.
+        Call this base method before creating labels in the element.
+        """
+
+    def create_shapes(self):
+        """
+        Create shapes (if applicable) and call on all children.
+        Call this base method before creating shapes in the element.
+        """
+
+    def draw(self, widget, cr):
+        raise NotImplementedError()
+
     def bounds_from_area(self, area):
         x1, y1, w, h = area
         x2 = x1 + w
diff --git a/grc/gui/FlowGraph.py b/grc/gui/FlowGraph.py
index 5cd575d..83796f3 100644
--- a/grc/gui/FlowGraph.py
+++ b/grc/gui/FlowGraph.py
@@ -1,5 +1,5 @@
 """
-Copyright 2007-2011 Free Software Foundation, Inc.
+Copyright 2007-2011, 2016q Free Software Foundation, Inc.
 This file is part of GNU Radio
 
 GNU Radio Companion is free software; you can redistribute it and/or
@@ -168,6 +168,7 @@ class FlowGraph(CoreFlowgraph, Element):
         """
         self.rewrite()
         self.validate()
+        self.update_elements_to_draw()
         self.create_labels()
         self.create_shapes()
 
@@ -469,6 +470,14 @@ class FlowGraph(CoreFlowgraph, Element):
                 continue  # skip hidden disabled blocks and connections
             self._elements_to_draw.append(element)
 
+    def create_labels(self):
+        for element in self._elements_to_draw:
+            element.create_labels()
+
+    def create_shapes(self):
+        for element in self._elements_to_draw:
+            element.create_shapes()
+
     def _drawables(self):
         show_comments = Actions.TOGGLE_SHOW_BLOCK_COMMENTS.get_active()
         for element in self._elements_to_draw:
@@ -479,9 +488,6 @@ class FlowGraph(CoreFlowgraph, Element):
 
     def draw(self, widget, cr):
         """Draw blocks connections comment and select rectangle"""
-        # todo: only update if required, duplicate logic in
-        self.update_elements_to_draw()
-
         for draw_element in self._drawables():
             cr.save()
             draw_element(widget, cr)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]