summaryrefslogtreecommitdiff
path: root/grc/gui/Port.py
diff options
context:
space:
mode:
authorTom <trondeau@vt.edu>2009-10-06 10:40:39 -0700
committerTom <trondeau@vt.edu>2009-10-06 10:40:39 -0700
commitbbd3df51732b2b63ae9d20e9fddd12229cf6b2ef (patch)
treedbf63fb638238e389ad970f2f4443299491e8fc6 /grc/gui/Port.py
parent314726ae7457b37f442a2751285b75b0d616c0f4 (diff)
parent3f8026a00c261c788357b3a04f5b338a6cda4d0e (diff)
Merge branch 'master' into sync
Conflicts: gr-utils/src/python/gr_plot_qt.py gr-utils/src/python/pyqt_plot.py gr-utils/src/python/pyqt_plot.ui
Diffstat (limited to 'grc/gui/Port.py')
-rw-r--r--grc/gui/Port.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/grc/gui/Port.py b/grc/gui/Port.py
index 6fc2c4b155..6763f6cbd5 100644
--- a/grc/gui/Port.py
+++ b/grc/gui/Port.py
@@ -34,7 +34,7 @@ PORT_MARKUP_TMPL="""\
class Port(Element):
"""The graphical port."""
- def __init__(self, *args, **kwargs):
+ def __init__(self):
"""
Port contructor.
Create list of connector coordinates.
@@ -42,9 +42,9 @@ class Port(Element):
Element.__init__(self)
self.connector_coordinates = dict()
- def update(self):
+ def create_shapes(self):
"""Create new areas and labels for the port."""
- self.clear()
+ Element.create_shapes(self)
#get current rotation
rotation = self.get_rotation()
#get all sibling ports
@@ -82,8 +82,9 @@ class Port(Element):
#the connector length
self._connector_length = CONNECTOR_EXTENSION_MINIMAL + CONNECTOR_EXTENSION_INCREMENT*index
- def _create_labels(self):
+ def create_labels(self):
"""Create the labels for the socket."""
+ Element.create_labels(self)
self._bg_color = Colors.get_color(self.get_color())
#create the layout
layout = gtk.DrawingArea().create_pango_layout('')
@@ -114,7 +115,7 @@ class Port(Element):
border_color=self.is_highlighted() and Colors.HIGHLIGHT_COLOR or Colors.BORDER_COLOR,
)
X,Y = self.get_coordinate()
- (x,y),(w,h) = self.areas_dict[self.get_rotation()][0] #use the first area's sizes to place the labels
+ (x,y),(w,h) = self._areas_list[0] #use the first area's sizes to place the labels
if self.is_horizontal():
window.draw_image(gc, self.horizontal_label, 0, 0, x+X+(self.W-self.w)/2, y+Y+(self.H-self.h)/2, -1, -1)
elif self.is_vertical():