git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- redraw now in idle
[enigma2.git]
/
components.py
diff --git
a/components.py
b/components.py
index e66e43b1818c7dd28535f0f804d50cbdbf2e5887..8ae480681f8eba24abfc6c74c23f3b5aa007624a 100644
(file)
--- a/
components.py
+++ b/
components.py
@@
-35,9
+35,7
@@
class GUIComponent:
def GUIcreate(self, priv, parent, skindata):
i = self.GUIcreateInstance(self, parent, skindata)
priv["instance"] = i
def GUIcreate(self, priv, parent, skindata):
i = self.GUIcreateInstance(self, parent, skindata)
priv["instance"] = i
- print str(self) + " notifier list before " + str(self.notifier)
self.notifier.append(i)
self.notifier.append(i)
- print str(self) + " notifier list now " + str(self.notifier)
if self.notifierAdded:
self.notifierAdded(i)
if self.notifierAdded:
self.notifierAdded(i)
@@
-53,7
+51,6
@@
class VariableText:
def setText(self, text):
if self.message != text:
self.message = text
def setText(self, text):
if self.message != text:
self.message = text
- print self.notifier
for x in self.notifier:
x.setText(self.message)
for x in self.notifier:
x.setText(self.message)
@@
-85,6
+82,10
@@
class Clock(HTMLComponent, GUIComponent, VariableText):
VariableText.__init__(self)
GUIComponent.__init__(self)
self.doClock()
VariableText.__init__(self)
GUIComponent.__init__(self)
self.doClock()
+
+ self.clockTimer = eTimer()
+ self.clockTimer.timeout.get().append(self.doClock)
+ self.clockTimer.start(1000)
# "funktionalitaet"
def doClock(self):
# "funktionalitaet"
def doClock(self):
@@
-100,12
+101,20
@@
class Clock(HTMLComponent, GUIComponent, VariableText):
return self.getText()
class Button(HTMLComponent, GUIComponent, VariableText):
return self.getText()
class Button(HTMLComponent, GUIComponent, VariableText):
- onClick = {}
-
def __init__(self, text=""):
GUIComponent.__init__(self)
VariableText.__init__(self)
self.setText(text)
def __init__(self, text=""):
GUIComponent.__init__(self)
VariableText.__init__(self)
self.setText(text)
+ self.onClick = [ ]
+
+ def clicked(self):
+ for x in self.onClick:
+ x()
+ return 0
+
+ def GUIcreate(self, priv, parent, skindata):
+ GUIComponent.GUIcreate(self, priv,parent, skindata)
+ priv["instance"].selected.get().append(self.clicked)
def click(self):
for x in self.onClick:
def click(self):
for x in self.onClick: