summaryrefslogtreecommitdiff
path: root/examples/elementary/test_floating.py
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2013-11-02 02:10:56 +0200
committerKai Huuhko <kai.huuhko@gmail.com>2013-11-02 02:10:56 +0200
commita2364dba2c6cb275b3d3e592d128bfbc4a650dc0 (patch)
tree0e1fcddc0414c39075fa453116beed3efed708a1 /examples/elementary/test_floating.py
parentfc69997a7525b60c3ae1501be0e23d1371bf7472 (diff)
Elementary: Examples, part N.
"We're doing it, we're doing it! Stop being so testy." - Vincent Price as The Sinister Man, addressing Satan.
Diffstat (limited to 'examples/elementary/test_floating.py')
-rw-r--r--examples/elementary/test_floating.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/examples/elementary/test_floating.py b/examples/elementary/test_floating.py
index 363be8c..61182d5 100644
--- a/examples/elementary/test_floating.py
+++ b/examples/elementary/test_floating.py
@@ -9,6 +9,9 @@ from efl.ecore import Animator, loop_time_get
9from efl.evas import EVAS_ASPECT_CONTROL_VERTICAL, EVAS_HINT_EXPAND, \ 9from efl.evas import EVAS_ASPECT_CONTROL_VERTICAL, EVAS_HINT_EXPAND, \
10 EVAS_HINT_FILL 10 EVAS_HINT_FILL
11 11
12EXPAND_BOTH = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
13FILL_BOTH = EVAS_HINT_FILL, EVAS_HINT_FILL
14
12class ItemClass(GenlistItemClass): 15class ItemClass(GenlistItemClass):
13 def text_get(self, obj, part, *args, **kwargs): 16 def text_get(self, obj, part, *args, **kwargs):
14 return "Item #{0}".format(args[0]) 17 return "Item #{0}".format(args[0])
@@ -19,7 +22,7 @@ class ItemClass(GenlistItemClass):
19 ic.size_hint_aspect = EVAS_ASPECT_CONTROL_VERTICAL, 1, 1 22 ic.size_hint_aspect = EVAS_ASPECT_CONTROL_VERTICAL, 1, 1
20 return ic 23 return ic
21 24
22def gl_sel_cb(obj, event_info, *args): 25def gl_sel_cb(obj, event_info, data):
23 print("sel item data [{0}] on genlist obj [{1}], item [{2}]".format(data, obj, event_info)) 26 print("sel item data [{0}] on genlist obj [{1}], item [{2}]".format(data, obj, event_info))
24 27
25def anim(*args, **kwargs): 28def anim(*args, **kwargs):
@@ -35,20 +38,15 @@ def del_cb(obj, *args, **kwargs):
35 ani.delete() 38 ani.delete()
36 39
37def floating_clicked(obj): 40def floating_clicked(obj):
38 win = StandardWindow("floating", "Floating") 41 win = StandardWindow("floating", "Floating", autodel=True, size=(480, 800))
39 win.autodel = True 42
40 43 gl = Genlist(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
41 gl = Genlist(win) 44 pos=(800, 0), size=(480, 800))
42 gl.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
43 gl.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL
44 gl.move(800, 0)
45 gl.size = 480, 800
46 gl.show() 45 gl.show()
47 46
48 for i in range(20): 47 for i in range(20):
49 GenlistItem(ItemClass(), i, None, ELM_GENLIST_ITEM_NONE, gl_sel_cb, i).append_to(gl) 48 GenlistItem(ItemClass(), i, None, ELM_GENLIST_ITEM_NONE, gl_sel_cb, i).append_to(gl)
50 49
51 win.size = 480, 800
52 win.show() 50 win.show()
53 51
54 ani = Animator(anim, gl) 52 ani = Animator(anim, gl)