summaryrefslogtreecommitdiff
path: root/grc/src/platforms/gui/FlowGraph.py
diff options
context:
space:
mode:
Diffstat (limited to 'grc/src/platforms/gui/FlowGraph.py')
-rw-r--r--grc/src/platforms/gui/FlowGraph.py25
1 files changed, 10 insertions, 15 deletions
diff --git a/grc/src/platforms/gui/FlowGraph.py b/grc/src/platforms/gui/FlowGraph.py
index 11942eb2e..82b45dc03 100644
--- a/grc/src/platforms/gui/FlowGraph.py
+++ b/grc/src/platforms/gui/FlowGraph.py
@@ -247,10 +247,6 @@ class FlowGraph(Element):
Draw all of the elements in this flow graph onto the pixmap.
Draw the pixmap to the drawable window of this flow graph.
"""
- try: #set the size of the flow graph area (if changed)
- new_size = self.get_option('window_size')
- if self.get_size() != tuple(new_size): self.set_size(*new_size)
- except: pass
W,H = self.get_size()
#draw the background
gc.foreground = Colors.BACKGROUND_COLOR
@@ -275,27 +271,26 @@ class FlowGraph(Element):
for selected_element in self.get_selected_connections() + self.get_selected_blocks():
selected_element.draw(gc, window)
- def update_highlighting(self):
+ def update_selected(self):
"""
+ Remove deleted elements from the selected elements list.
Update highlighting so only the selected are highlighted.
"""
selected_elements = self.get_selected_elements()
- for element in self.get_elements():
+ elements = self.get_elements()
+ #remove deleted elements
+ for selected in selected_elements:
+ if selected in elements: continue
+ selected_elements.remove(selected)
+ #update highlighting
+ for element in elements:
element.set_highlighted(element in selected_elements)
def update(self):
"""
- Removed deleted elements from the selected elements list.
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 in elements: continue
- selected_elements.remove(selected)
- #update all
- for element in elements: element.update()
+ for element in self.get_elements(): element.update()
##########################################################################
## Get Selected