aboutsummaryrefslogtreecommitdiffstats
path: root/examples/elementary
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2016-02-02 21:23:02 +0200
committerKai Huuhko <kai.huuhko@gmail.com>2016-02-02 21:23:02 +0200
commit523fe8ad4dc3e271586ade9972faec24a69e0a2c (patch)
treed74ec17252f8020d93d4397a530c59a06194c741 /examples/elementary
parentElm.MultiButtonEntry: Attempt to fix leaks, add more docs (diff)
downloadpython-efl-523fe8ad4dc3e271586ade9972faec24a69e0a2c.tar.gz
Elm.MultiButtonEntry: Fix filter callback
Diffstat (limited to 'examples/elementary')
-rw-r--r--examples/elementary/test_multibuttonentry.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/examples/elementary/test_multibuttonentry.py b/examples/elementary/test_multibuttonentry.py
index 989598f..59681c4 100644
--- a/examples/elementary/test_multibuttonentry.py
+++ b/examples/elementary/test_multibuttonentry.py
@@ -6,7 +6,7 @@ from efl import elementary
from efl.elementary import StandardWindow
from efl.elementary import Box
from efl.elementary import Button
-from efl.elementary import MultiButtonEntry, MultiButtonEntryFilterOut
+from efl.elementary import MultiButtonEntry
from efl.elementary import Scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO
SCROLL_POLICY_VERT = ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO
@@ -55,13 +55,13 @@ def cb_btn_clear2(btn, mbe):
def cb_filter1(mbe, text):
print(text)
+ return True
def cb_filter2(mbe, text):
- return text[:-2]
-
-def cb_filter3(mbe, text):
- print(text)
- #raise MultiButtonEntryFilterOut
+ if text == "nope":
+ return False
+ else:
+ return True
def cb_print(btn, mbe):
for i in mbe.items:
@@ -86,10 +86,9 @@ def multibuttonentry_clicked(obj, item=None):
mbe.callback_item_selected_add(cb_item_selected)
mbe.callback_item_clicked_add(cb_item_clicked)
mbe.callback_item_longpressed_add(cb_item_longpressed)
- mbe.part_text_set("guide", "Tap to add recipient")
+ mbe.part_text_set("guide", "Tap to add recipient. Type \"nope\" to test filter rejection.")
mbe.filter_append(cb_filter1)
mbe.filter_append(cb_filter2)
- mbe.filter_append(cb_filter3)
mbe.show()
sc = Scroller(win, bounce=(False, True), policy=SCROLL_POLICY_VERT,