summaryrefslogtreecommitdiff
path: root/examples/elementary/test_floating.py
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2013-11-03 10:42:50 +0200
committerKai Huuhko <kai.huuhko@gmail.com>2013-11-03 10:42:50 +0200
commitcf1f98bbf611ad14662254988a48529cfedcf49c (patch)
tree870be59a45571058abf7d380dbf6ecc359ad5748 /examples/elementary/test_floating.py
parent23e9d4920875906c7f90fb4a8dd91c68e9522c07 (diff)
Elementary: Improve the rest of the examples.
Summary of changes: - Make use of constructor keyword args - Most scripts are now working directory agnostic - Enabled evas textgrid example - Printed messages are slightly better formatted
Diffstat (limited to 'examples/elementary/test_floating.py')
-rw-r--r--examples/elementary/test_floating.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/elementary/test_floating.py b/examples/elementary/test_floating.py
index 61182d5..5072bdb 100644
--- a/examples/elementary/test_floating.py
+++ b/examples/elementary/test_floating.py
@@ -12,15 +12,17 @@ from efl.evas import EVAS_ASPECT_CONTROL_VERTICAL, EVAS_HINT_EXPAND, \
12EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND 12EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
13FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL 13FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
14 14
15script_path = os.path.dirname(os.path.abspath(__file__))
16img_path = os.path.join(script_path, "images")
17
15class ItemClass(GenlistItemClass): 18class ItemClass(GenlistItemClass):
16 def text_get(self, obj, part, *args, **kwargs): 19 def text_get(self, obj, part, *args, **kwargs):
17 return "Item #{0}".format(args[0]) 20 return "Item #{0}".format(args[0])
18 21
19 def content_get(self, obj, part, *args, **kwargs): 22 def content_get(self, obj, part, *args, **kwargs):
20 ic = Icon(obj) 23 ic = Icon(obj, file=os.path.join(img_path, "logo_small.png"),
21 ic.file = "images/logo_small.png" 24 size_hint_aspect=(EVAS_ASPECT_CONTROL_VERTICAL, 1, 1))
22 ic.size_hint_aspect = EVAS_ASPECT_CONTROL_VERTICAL, 1, 1 25 return ic
23 return ic
24 26
25def gl_sel_cb(obj, event_info, data): 27def gl_sel_cb(obj, event_info, data):
26 print("sel item data [{0}] on genlist obj [{1}], item [{2}]".format(data, obj, event_info)) 28 print("sel item data [{0}] on genlist obj [{1}], item [{2}]".format(data, obj, event_info))