X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/9c22bd14f76cbc38c14d417dc185cdcdfc610665..fb284fcd5704b0f710ece9d0e6064d53ad4aa35e:/lib/python/Components/Button.py diff --git a/lib/python/Components/Button.py b/lib/python/Components/Button.py index cb4b4213..25346b42 100644 --- a/lib/python/Components/Button.py +++ b/lib/python/Components/Button.py @@ -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,8 @@ class Button(HTMLComponent, GUIComponent, VariableText): def produceHTML(self): return "\n" -# GUI: - def createWidget(self, parent): - g = eButton(parent) - g.selected.get().append(self.push) - return g - - def removeWidget(self, w): - w.selected.get().remove(self.push) + GUI_WIDGET = eButton + def postWidgetCreate(self, instance): + instance.setText(self.text) + instance.selected.get().append(self.push)