summaryrefslogtreecommitdiff
path: root/grc/src/platforms/gui
diff options
context:
space:
mode:
authorjblum2009-05-05 18:35:39 +0000
committerjblum2009-05-05 18:35:39 +0000
commit977674398e17ee07362fe986e0573cf1be69554e (patch)
tree034ba4253e8a5179712e3bf3e54935e4e78e5677 /grc/src/platforms/gui
parente2a718865bbcb7196637404855447cbe4d0b88f6 (diff)
downloadgnuradio-977674398e17ee07362fe986e0573cf1be69554e.tar.gz
gnuradio-977674398e17ee07362fe986e0573cf1be69554e.tar.bz2
gnuradio-977674398e17ee07362fe986e0573cf1be69554e.zip
speed up for flow graphs with many blocks:
separated highlighting update logic so update does not have to be called on selection. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10958 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc/src/platforms/gui')
-rw-r--r--grc/src/platforms/gui/FlowGraph.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/grc/src/platforms/gui/FlowGraph.py b/grc/src/platforms/gui/FlowGraph.py
index 37157ac7c..11942eb2e 100644
--- a/grc/src/platforms/gui/FlowGraph.py
+++ b/grc/src/platforms/gui/FlowGraph.py
@@ -275,21 +275,27 @@ class FlowGraph(Element):
for selected_element in self.get_selected_connections() + self.get_selected_blocks():
selected_element.draw(gc, window)
+ def update_highlighting(self):
+ """
+ Update highlighting so only the selected are highlighted.
+ """
+ selected_elements = self.get_selected_elements()
+ for element in self.get_elements():
+ element.set_highlighted(element in selected_elements)
+
def update(self):
"""
Removed deleted elements from the selected elements list.
- Update highlighting so only the selected is highlighted.
Call update on all elements.
"""
selected_elements = self.get_selected_elements()
+ elements = self.get_elements()
#remove deleted elements
for selected in selected_elements:
- if selected not in self.get_elements():
- selected_elements.remove(selected)
- #set highlight and update all
- for element in self.get_elements():
- element.set_highlighted(element in selected_elements)
- element.update()
+ if selected in elements: continue
+ selected_elements.remove(selected)
+ #update all
+ for element in elements: element.update()
##########################################################################
## Get Selected