summaryrefslogtreecommitdiff
path: root/examples/elementary/test_ctxpopup.py
diff options
context:
space:
mode:
authordavemds <dave@gurumeditation.it>2014-07-31 22:18:41 +0200
committerdavemds <dave@gurumeditation.it>2014-07-31 22:18:41 +0200
commita97e61dd4ffceb30e62cc0973e879e60a8d43169 (patch)
treeeddca5af9d991456fb8bc532237c26c88969789e /examples/elementary/test_ctxpopup.py
parent5aa12930a1ac3971d36c3b713fa010d96cd1c607 (diff)
Ctxpopup: new getters for items and the item_prepend method, with tests
Diffstat (limited to 'examples/elementary/test_ctxpopup.py')
-rw-r--r--examples/elementary/test_ctxpopup.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/examples/elementary/test_ctxpopup.py b/examples/elementary/test_ctxpopup.py
index ce1120f..af874a0 100644
--- a/examples/elementary/test_ctxpopup.py
+++ b/examples/elementary/test_ctxpopup.py
@@ -59,10 +59,33 @@ def cb_item1(li, item):
59 it = item_new(cp, "Sate date and time", "clock") 59 it = item_new(cp, "Sate date and time", "clock")
60 it.disabled = True 60 it.disabled = True
61 61
62 ic = Icon(cp, standard="home", resizable=(False,False))
63 cp.item_prepend("Prepended item", ic, cb_items)
64
62 (x, y) = li.evas.pointer_canvas_xy_get() 65 (x, y) = li.evas.pointer_canvas_xy_get()
63 cp.move(x, y) 66 cp.move(x, y)
64 cp.show() 67 cp.show()
65 68
69 print("\n### Testing items getters 1")
70 for it in cp.items:
71 print("ITEM: " + it.text)
72
73 print("\n### Testing items getters 2")
74 print("FIRST ITEM: " + cp.first_item.text)
75 print("LAST ITEM: " + cp.last_item.text)
76
77 print("\n### Testing items getters 3")
78 it = cp.first_item
79 while it:
80 print("ITEM: " + it.text)
81 it = it.next
82
83 print("\n### Testing items getters 4")
84 it = cp.last_item
85 while it:
86 print("ITEM: " + it.text)
87 it = it.prev
88
66def cb_item2(li, item): 89def cb_item2(li, item):
67 cp = Ctxpopup(li) 90 cp = Ctxpopup(li)
68 it = item_new(cp, "", "home") 91 it = item_new(cp, "", "home")