diff options
author | Dave Andreoli <dave@gurumeditation.it> | 2016-02-08 20:12:49 +0100 |
---|---|---|
committer | Dave Andreoli <dave@gurumeditation.it> | 2016-02-08 20:12:49 +0100 |
commit | d119b938638541db08c2cc7a84fbc53286b0a128 (patch) | |
tree | 4e289b613399aa584705c9104e829b3a776d5b4d | |
parent | 666817672096502a197bae021617348fde501b14 (diff) |
Fix 2 examples to work with py2python-efl-1.17
(cherry picked from commit fea03a787c706f5d179910e0b06b4c95ed84ff67)
-rw-r--r-- | examples/elementary/test_combobox.py | 15 | ||||
-rw-r--r-- | examples/elementary/test_genlist_filter.py | 4 |
2 files changed, 13 insertions, 6 deletions
diff --git a/examples/elementary/test_combobox.py b/examples/elementary/test_combobox.py index 632e92e..97b5d53 100644 --- a/examples/elementary/test_combobox.py +++ b/examples/elementary/test_combobox.py | |||
@@ -40,6 +40,11 @@ def combobox_item_pressed_cb(cbox, item): | |||
40 | def combobox_changed_cb(cbox): | 40 | def combobox_changed_cb(cbox): |
41 | cbox.filter = cbox.text | 41 | cbox.filter = cbox.text |
42 | 42 | ||
43 | def generic_obj_cb(cbox, event_name): | ||
44 | print("EV", event_name, cbox) | ||
45 | |||
46 | def generic_item_cb(cbox, item, event_name): | ||
47 | print("EV", event_name, item) | ||
43 | 48 | ||
44 | def combobox_clicked(obj): | 49 | def combobox_clicked(obj): |
45 | win = StandardWindow("combobox", "Combobox", autodel=True, size=(320, 500)) | 50 | win = StandardWindow("combobox", "Combobox", autodel=True, size=(320, 500)) |
@@ -57,10 +62,10 @@ def combobox_clicked(obj): | |||
57 | size_hint_fill=FILL_HORIZ) | 62 | size_hint_fill=FILL_HORIZ) |
58 | cbox1.part_text_set("guide", "A short list (with callbacks attached)") | 63 | cbox1.part_text_set("guide", "A short list (with callbacks attached)") |
59 | cbox1.callback_item_pressed_add(combobox_item_pressed_cb) | 64 | cbox1.callback_item_pressed_add(combobox_item_pressed_cb) |
60 | cbox1.callback_dismissed_add(lambda cbox: print("DISMISSED", cbox)) | 65 | cbox1.callback_dismissed_add(generic_obj_cb, "DISMISSED") |
61 | cbox1.callback_expanded_add(lambda cbox: print("EXPANDED", cbox)) | 66 | cbox1.callback_expanded_add(generic_obj_cb, "EXPANDED") |
62 | cbox1.callback_clicked_add(lambda cbox: print("CLICKED", cbox)) | 67 | cbox1.callback_clicked_add(generic_obj_cb, "CLICKED") |
63 | cbox1.callback_item_selected_add(lambda cbox, item: print("ITEM,SELECTED", item)) | 68 | cbox1.callback_item_selected_add(generic_item_cb, "ITEM,SELECTED") |
64 | 69 | ||
65 | for i in range(1, 7): | 70 | for i in range(1, 7): |
66 | cbox1.item_append(itc, "Item # %d" % i) | 71 | cbox1.item_append(itc, "Item # %d" % i) |
@@ -73,7 +78,7 @@ def combobox_clicked(obj): | |||
73 | cbox2.part_text_set("guide", "A long list (with item filtering)") | 78 | cbox2.part_text_set("guide", "A long list (with item filtering)") |
74 | cbox2.callback_item_pressed_add(combobox_item_pressed_cb) | 79 | cbox2.callback_item_pressed_add(combobox_item_pressed_cb) |
75 | cbox2.callback_changed_add(combobox_changed_cb) | 80 | cbox2.callback_changed_add(combobox_changed_cb) |
76 | cbox2.callback_filter_done_add(lambda cbox: print("FILTER,DONE", cbox)) | 81 | cbox2.callback_filter_done_add(generic_obj_cb, "FILTER,DONE") |
77 | 82 | ||
78 | for i in range(1, 1001): | 83 | for i in range(1, 1001): |
79 | cbox2.item_append(itc, "Item # %d" % i) | 84 | cbox2.item_append(itc, "Item # %d" % i) |
diff --git a/examples/elementary/test_genlist_filter.py b/examples/elementary/test_genlist_filter.py index 7b35491..ff69149 100644 --- a/examples/elementary/test_genlist_filter.py +++ b/examples/elementary/test_genlist_filter.py | |||
@@ -37,6 +37,8 @@ def gl_filter_get(obj, key, item_data): | |||
37 | def entry_changed_cb(en, gl): | 37 | def entry_changed_cb(en, gl): |
38 | gl.filter = en.text or None | 38 | gl.filter = en.text or None |
39 | 39 | ||
40 | def filter_done_cb(gl): | ||
41 | print("filter,done") | ||
40 | 42 | ||
41 | def test_genlist_filter(parent): | 43 | def test_genlist_filter(parent): |
42 | win = StandardWindow("genlist-filter", "Genlist Filter", autodel=True, | 44 | win = StandardWindow("genlist-filter", "Genlist Filter", autodel=True, |
@@ -52,7 +54,7 @@ def test_genlist_filter(parent): | |||
52 | gl = Genlist(win, mode=elm.ELM_LIST_COMPRESS, homogeneous=True, | 54 | gl = Genlist(win, mode=elm.ELM_LIST_COMPRESS, homogeneous=True, |
53 | select_mode=elm.ELM_OBJECT_SELECT_MODE_ALWAYS, | 55 | select_mode=elm.ELM_OBJECT_SELECT_MODE_ALWAYS, |
54 | size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH) | 56 | size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH) |
55 | gl.callback_filter_done_add(lambda g: print("filter,done")) | 57 | gl.callback_filter_done_add(filter_done_cb) |
56 | gl.show() | 58 | gl.show() |
57 | box.pack_end(gl) | 59 | box.pack_end(gl) |
58 | 60 | ||