summaryrefslogtreecommitdiff
path: root/grc/gui/FlowGraph.py
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2015-09-04 05:40:24 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2015-09-04 05:40:24 -0700
commit80d52551db67b2e80955eaadbbc63a54d4d4abbc (patch)
treec84957617025cf5a857e26b9993eee16500780dc /grc/gui/FlowGraph.py
parent8ec2b0ed041bd62c11d64ca46cf497a544ed05f4 (diff)
parent791c1a705d9e1457d9c09c79c7f1300c2ac63f5e (diff)
Merge remote-tracking branch 'gnuradio-wg-grc/master_grcwg'
Diffstat (limited to 'grc/gui/FlowGraph.py')
-rw-r--r--grc/gui/FlowGraph.py22
1 files changed, 10 insertions, 12 deletions
diff --git a/grc/gui/FlowGraph.py b/grc/gui/FlowGraph.py
index bf6e1eed78..b1e88aae8e 100644
--- a/grc/gui/FlowGraph.py
+++ b/grc/gui/FlowGraph.py
@@ -17,17 +17,14 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
-from Constants import SCROLL_PROXIMITY_SENSITIVITY, SCROLL_DISTANCE
-import Actions
-import Colors
-import Utils
-from Element import Element
-import pygtk
-pygtk.require('2.0')
-import gtk
import random
-import Messages
-import Bars
+from itertools import chain
+from operator import methodcaller
+
+from . import Actions, Colors, Utils, Messages, Bars
+from .Constants import SCROLL_PROXIMITY_SENSITIVITY, SCROLL_DISTANCE
+from .Element import Element
+
class FlowGraph(Element):
"""
@@ -294,7 +291,7 @@ class FlowGraph(Element):
window.draw_rectangle(gc, True, 0, 0, W, H)
# draw comments first
if Actions.TOGGLE_SHOW_BLOCK_COMMENTS.get_active():
- for block in self.get_blocks():
+ for block in self.iter_blocks():
if block.get_enabled():
block.draw_comment(gc, window)
#draw multi select rectangle
@@ -312,7 +309,8 @@ class FlowGraph(Element):
window.draw_rectangle(gc, False, x, y, w, h)
#draw blocks on top of connections
hide_disabled_blocks = Actions.TOGGLE_HIDE_DISABLED_BLOCKS.get_active()
- for element in self.get_connections() + self.get_blocks():
+ blocks = sorted(self.iter_blocks(), key=methodcaller('get_enabled'))
+ for element in chain(self.iter_connections(), blocks):
if hide_disabled_blocks and not element.get_enabled():
continue # skip hidden disabled blocks and connections
element.draw(gc, window)