diff options
author | Sebastian Koslowski <koslowski@kit.edu> | 2016-07-14 14:32:20 +0200 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2016-07-29 15:44:45 +0200 |
commit | 36f186bc46f528d95d9186955e91736d1fdb299e (patch) | |
tree | 7af20e85e4696be152d211df1f8bff0044ad0257 /grc/gui/Element.py | |
parent | e9dae9194c5abc5582f640f4d5a66794dcdeb8ca (diff) |
grc: dynamic super-classing proof-of-concept =)
Diffstat (limited to 'grc/gui/Element.py')
-rw-r--r-- | grc/gui/Element.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/grc/gui/Element.py b/grc/gui/Element.py index b51a64735f..cdbf548941 100644 --- a/grc/gui/Element.py +++ b/grc/gui/Element.py @@ -30,6 +30,13 @@ class Element(object): and methods to detect selection of those areas. """ + @classmethod + def make_cls_with_base(cls, super_cls): + name = super_cls.__name__ + bases = (super_cls,) + cls.__bases__[1:] + namespace = cls.__dict__.copy() + return type(name, bases, namespace) + def __init__(self): """ Make a new list of rectangular areas and lines, and set the coordinate and the rotation. |