summaryrefslogtreecommitdiff
path: root/grc/src/platforms
diff options
context:
space:
mode:
authorjblum2009-05-06 07:26:58 +0000
committerjblum2009-05-06 07:26:58 +0000
commit79c75e2cadd885afd0b34f30a6926ad908e1d896 (patch)
treea0c991af1df800ecc937cf6f0b982b06819bd654 /grc/src/platforms
parent39a30740c97dbd0ccd4a3effbb1f88a3da491532 (diff)
downloadgnuradio-79c75e2cadd885afd0b34f30a6926ad908e1d896.tar.gz
gnuradio-79c75e2cadd885afd0b34f30a6926ad908e1d896.tar.bz2
gnuradio-79c75e2cadd885afd0b34f30a6926ad908e1d896.zip
Moved resizing logic out of animation path.
Drawing area configure event for pixmap creation. State handler for flow graph resizing. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10978 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc/src/platforms')
-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