3 from enigma import ePoint
5 class GUIComponent(object):
11 self.skinAttributes = None
28 # this works only with normal widgets - if you don't have self.instance, override this.
29 def applySkin(self, desktop):
33 if self.skinAttributes is None:
34 print "warning, skin is missing some elements."
37 skin.applyAllAttributes(self.instance, desktop, self.skinAttributes)
40 self.instance.move(ePoint(int(x), int(y)))
44 if self.instance is not None:
49 if self.instance is not None:
55 def setVisible(self, visible):
61 visible = property(getVisible, setVisible)
63 def setPosition(self, x, y):
64 self.instance.move(ePoint(int(x), int(y)))
66 def getPosition(self):
67 p = self.instance.position()
70 position = property(getPosition, setPosition)
72 # default implementation for only one widget per component
73 # feel free to override!
74 def GUIcreate(self, parent):
75 self.instance = self.createWidget(parent)
76 self.postWidgetCreate(self.instance)
79 self.preWidgetRemove(self.instance)
82 # default for argumentless widget constructor
83 def createWidget(self, parent):
84 return self.GUI_WIDGET(parent)
86 def postWidgetCreate(self, instance):
89 def preWidgetRemove(self, instance):