diff options
author | Sebastian Koslowski <koslowski@kit.edu> | 2016-07-12 11:53:42 +0200 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2016-07-13 16:35:50 +0200 |
commit | c01e2d0d9280bbfdec229d75f9a9186aa66f4701 (patch) | |
tree | 3ec10733e4ca813707f15e33485c3441bf8ae665 /grc/gui/Element.py | |
parent | cac9487e9bd0a9fa4bf50407af09d2665c4b7cd0 (diff) |
grc: gtk3: update block surface draw code
Diffstat (limited to 'grc/gui/Element.py')
-rw-r--r-- | grc/gui/Element.py | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/grc/gui/Element.py b/grc/gui/Element.py index c4d5b5e47d..9513b44dc6 100644 --- a/grc/gui/Element.py +++ b/grc/gui/Element.py @@ -21,11 +21,7 @@ from __future__ import absolute_import from .Constants import LINE_SELECT_SENSITIVITY from .Constants import POSSIBLE_ROTATIONS -import gi from six.moves import zip -gi.require_version('Gtk', '3.0') -from gi.repository import Gtk -from gi.repository import Gdk class Element(object): @@ -41,12 +37,10 @@ class Element(object): """ self.set_rotation(POSSIBLE_ROTATIONS[0]) self.set_coordinate((0, 0)) - self.clear() self.highlighted = False - self.line_attributes = [] - """ # No idea where this is in pygobject - 0, Gdk.LINE_SOLID, Gdk.CAP_BUTT, Gdk.JOIN_MITER - ]""" + + self._areas_list = [] + self._lines_list = [] def is_horizontal(self, rotation=None): """ @@ -81,7 +75,8 @@ class Element(object): Create labels (if applicable) and call on all children. Call this base method before creating labels in the element. """ - for child in self.get_children():child.create_labels() + for child in self.get_children(): + child.create_labels() def create_shapes(self): """ @@ -89,7 +84,8 @@ class Element(object): Call this base method before creating shapes in the element. """ self.clear() - for child in self.get_children(): child.create_shapes() + for child in self.get_children(): + child.create_shapes() def draw(self, widget, cr, border_color, bg_color): """ @@ -131,8 +127,8 @@ class Element(object): def clear(self): """Empty the lines and areas.""" - self._areas_list = list() - self._lines_list = list() + del self._areas_list[:] + del self._lines_list[:] def set_coordinate(self, coor): """ |