Merge commit 'origin/translations' into experimental
[enigma2.git] / lib / python / Components / Button.py
index cb4b42139550fad53e2be63be7407480741166bc..2a60a98fa9a241e1f1083653127505442cb4e7cb 100644 (file)
@@ -1,10 +1,10 @@
-from HTMLComponent import *
-from GUIComponent import *
-from VariableText import *
+from HTMLComponent import HTMLComponent
+from GUIComponent import GUIComponent
+from VariableText import VariableText
 
 from enigma import eButton
 
-class Button(HTMLComponent, GUIComponent, VariableText):
+class Button(VariableText, HTMLComponent, GUIComponent):
        def __init__(self, text="", onClick = [ ]):
                GUIComponent.__init__(self)
                VariableText.__init__(self)
@@ -26,12 +26,11 @@ class Button(HTMLComponent, GUIComponent, VariableText):
        def produceHTML(self):
                return "<input type=\"submit\" text=\"" + self.getText() + "\">\n"
 
-# GUI:
-       def createWidget(self, parent):
-               g = eButton(parent)
-               g.selected.get().append(self.push)
-               return g
+       GUI_WIDGET = eButton
 
-       def removeWidget(self, w):
-               w.selected.get().remove(self.push)
+       def postWidgetCreate(self, instance):
+               instance.setText(self.text)
+               instance.selected.get().append(self.push)
 
+       def preWidgetRemove(self, instance):
+               instance.selected.get().remove(self.push)