summaryrefslogtreecommitdiff
path: root/grc/gui/Block.py
diff options
context:
space:
mode:
authorSebastian Koslowski <koslowski@kit.edu>2016-04-25 21:25:44 +0200
committerSebastian Koslowski <koslowski@kit.edu>2016-05-27 15:02:41 +0200
commit31eb4e89dc6f3b1deb12175b10127967cdb7407c (patch)
treefa92cde4c28ae18b94d4a9eb0ccfcb65a0c9da1c /grc/gui/Block.py
parent5352dfd80fd238256da7bbd5efd15c154f3f5a14 (diff)
grc-refactor: start clean-up Block.py
Diffstat (limited to 'grc/gui/Block.py')
-rw-r--r--grc/gui/Block.py30
1 files changed, 6 insertions, 24 deletions
diff --git a/grc/gui/Block.py b/grc/gui/Block.py
index d16c9d01c6..57fb69c448 100644
--- a/grc/gui/Block.py
+++ b/grc/gui/Block.py
@@ -64,31 +64,13 @@ class Block(Element, _Block):
Add graphics related params to the block.
"""
_Block.__init__(self, flow_graph, n)
+ self.W = self.H = 0
+ self._add_param(key='_coordinate', name='GUI Coordinate', value='(0, 0)',
+ hide='all')
+ self._add_param(key='_rotation', name='GUI Rotation', value='0',
+ hide='all')
- self.W = 0
- self.H = 0
- #add the position param
- self.get_params().append(self.get_parent().get_parent().Param(
- block=self,
- n=odict({
- 'name': 'GUI Coordinate',
- 'key': '_coordinate',
- 'type': 'raw',
- 'value': '(0, 0)',
- 'hide': 'all',
- })
- ))
- self.get_params().append(self.get_parent().get_parent().Param(
- block=self,
- n=odict({
- 'name': 'GUI Rotation',
- 'key': '_rotation',
- 'type': 'raw',
- 'value': '0',
- 'hide': 'all',
- })
- ))
- Element.__init__(self)
+ Element.__init__(self) # needs the params
self._comment_pixmap = None
self._bg_color = Colors.BLOCK_ENABLED_COLOR
self.has_busses = [False, False] # source, sink