3 from enigma import ePoint
5 class GUIComponent(object):
27 # this works only with normal widgets - if you don't have self.instance, override this.
28 def applySkin(self, desktop):
31 skin.applyAllAttributes(self.instance, desktop, self.skinAttributes)
34 self.instance.move(ePoint(int(x), int(y)))
38 if self.instance is not None:
43 if self.instance is not None:
49 def setVisible(self, visible):
55 visible = property(getVisible, setVisible)
57 def setPosition(self, x, y):
58 self.instance.move(ePoint(int(x), int(y)))
60 def getPosition(self):
61 p = self.instance.position()
64 position = property(getPosition, setPosition)
66 # default implementation for only one widget per component
67 # feel free to override!
68 def GUIcreate(self, parent):
69 self.instance = self.createWidget(parent)
70 self.postWidgetCreate(self.instance)
73 self.preWidgetRemove(self.instance)
76 # default for argumentless widget constructor
77 def createWidget(self, parent):
78 return self.GUI_WIDGET(parent)
80 def postWidgetCreate(self, instance):
83 def preWidgetRemove(self, instance):