From c01e2d0d9280bbfdec229d75f9a9186aa66f4701 Mon Sep 17 00:00:00 2001
From: Sebastian Koslowski <koslowski@kit.edu>
Date: Tue, 12 Jul 2016 11:53:42 +0200
Subject: grc: gtk3: update block surface draw code

---
 grc/gui/Element.py | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

(limited to 'grc/gui/Element.py')

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):
         """
-- 
cgit v1.2.3