diff options
author | Josh Blum | 2009-09-05 02:21:37 -0700 |
---|---|---|
committer | Josh Blum | 2009-09-05 02:21:37 -0700 |
commit | fa465d160b0c53fae3ad7876cf429263157dd60a (patch) | |
tree | 12c1b47840f0f4af32ab43d9878fa725d092decf /grc/gui/Connection.py | |
parent | 5bb2a70a94be9c0f83712ee259b7125e3a582b08 (diff) | |
download | gnuradio-fa465d160b0c53fae3ad7876cf429263157dd60a.tar.gz gnuradio-fa465d160b0c53fae3ad7876cf429263157dd60a.tar.bz2 gnuradio-fa465d160b0c53fae3ad7876cf429263157dd60a.zip |
Created recursive create labels and shapes method for gui element.
Replaces update methods in the gui classes and simplifies calls.
The master update method in flow graph calls create labels and shapes.
Diffstat (limited to 'grc/gui/Connection.py')
-rw-r--r-- | grc/gui/Connection.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/grc/gui/Connection.py b/grc/gui/Connection.py index a85650ee2..45f8a689a 100644 --- a/grc/gui/Connection.py +++ b/grc/gui/Connection.py @@ -50,8 +50,9 @@ class Connection(Element): """ return 0 - def update(self): + def create_shapes(self): """Precalculate relative coordinates.""" + Element.create_shapes(self) self._sink_rot = None self._source_rot = None self._sink_coor = None @@ -74,7 +75,7 @@ class Connection(Element): def _update_after_move(self): """Calculate coordinates.""" - self.clear() + self.clear() #FIXME do i want this here? #source connector source = self.get_source() X, Y = source.get_connector_coordinate() @@ -125,7 +126,7 @@ class Connection(Element): sink = self.get_sink() source = self.get_source() #check for changes - if self._sink_rot != sink.get_rotation() or self._source_rot != source.get_rotation(): self.update() + if self._sink_rot != sink.get_rotation() or self._source_rot != source.get_rotation(): self.create_shapes() elif self._sink_coor != sink.get_coordinate() or self._source_coor != source.get_coordinate(): self._update_after_move() #cache values self._sink_rot = sink.get_rotation() |