aboutsummaryrefslogtreecommitdiffstats
path: root/examples/emotion
diff options
context:
space:
mode:
authordavemds <dave@gurumeditation.it>2013-05-14 23:13:26 +0200
committerdavemds <dave@gurumeditation.it>2013-05-14 23:13:26 +0200
commitfd131a2b690f2a15f532b3f6caf0303d7e2615a7 (patch)
treed53af0cca7578a772684ad3c81768d77ebbc48c5 /examples/emotion
parentPython-EFL: implemented decorators for edje. (diff)
downloadpython-efl-fd131a2b690f2a15f532b3f6caf0303d7e2615a7.tar.gz
Python-EFL: @on_event(event_name) decorator for Emotion
Diffstat (limited to 'examples/emotion')
-rwxr-xr-xexamples/emotion/test_emotion.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/examples/emotion/test_emotion.py b/examples/emotion/test_emotion.py
index fc0d158..3f89be7 100755
--- a/examples/emotion/test_emotion.py
+++ b/examples/emotion/test_emotion.py
@@ -6,6 +6,7 @@ import subprocess
from efl import evas
from efl import edje
from efl import emotion
+from efl.emotion import Emotion
from efl import elementary
from efl.elementary.window import Window
@@ -20,10 +21,19 @@ data_dir = prefix_dir + "/share/emotion/data"
theme_file = data_dir + "/theme.edj"
+class MyDecoratedEmotion(Emotion):
+ def __init__(self, canvas, module_name):
+ Emotion.__init__(self, canvas, module_name=module_name)
+
+ @emotion.on_event("frame_resize")
+ def cb_frame_decoded(self):
+ print("Decorated callback successfully called")
+
+
class MovieWindow(edje.Edje):
def __init__(self, canvas, media_module, media_file):
# emotion video
- self.vid = emotion.Emotion(canvas, module_name=media_module)
+ self.vid = MyDecoratedEmotion(canvas, module_name=media_module)
self.vid.file = media_file
self.vid.smooth_scale = True
self.vid.play = True