summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2015-04-17 21:16:09 +0200
committerDave Andreoli <dave@gurumeditation.it>2015-04-17 21:16:23 +0200
commitf6326d582bb9a80bdcc7324373322006f3c4b96e (patch)
tree5533078ce6fde52eb0053c8815de488a414bda2e
parentb7040059817027a2b25a2541444fa35a2241a5d3 (diff)
New 1.14 API: item,longressed signal for Multibuttonentry
-rw-r--r--efl/elementary/multibuttonentry.pyx14
-rw-r--r--examples/elementary/test_multibuttonentry.py14
2 files changed, 25 insertions, 3 deletions
diff --git a/efl/elementary/multibuttonentry.pyx b/efl/elementary/multibuttonentry.pyx
index ea2fe89..4207495 100644
--- a/efl/elementary/multibuttonentry.pyx
+++ b/efl/elementary/multibuttonentry.pyx
@@ -52,6 +52,8 @@ Emitted signals
52- ``item,clicked`` - this is called when an item is clicked by user 52- ``item,clicked`` - this is called when an item is clicked by user
53 interaction. Both "item,selected" and "item,clicked" are needed. 53 interaction. Both "item,selected" and "item,clicked" are needed.
54 event_info contains the item. 54 event_info contains the item.
55- ``item,longpressed`` - this is called when an item is longpressed by user
56 interaction. event_info contains the item. (since 1.14)
55- ``clicked`` - when multi-button entry is clicked. 57- ``clicked`` - when multi-button entry is clicked.
56- ``focused`` - when multi-button entry is focused. 58- ``focused`` - when multi-button entry is focused.
57- ``unfocused`` - when multi-button entry is unfocused. 59- ``unfocused`` - when multi-button entry is unfocused.
@@ -536,6 +538,18 @@ cdef class MultiButtonEntry(Object):
536 def callback_item_clicked_del(self, func): 538 def callback_item_clicked_del(self, func):
537 self._callback_del_full("item,clicked", _cb_object_item_conv, func) 539 self._callback_del_full("item,clicked", _cb_object_item_conv, func)
538 540
541 def callback_item_longpressed_add(self, func, *args, **kwargs):
542 """
543 .. versionadded:: 1.14
544 """
545 self._callback_add_full("item,longpressed", _cb_object_item_conv, func, args, kwargs)
546
547 def callback_item_longpressed_del(self, func):
548 """
549 .. versionadded:: 1.14
550 """
551 self._callback_del_full("item,longpressed", _cb_object_item_conv, func)
552
539 def callback_clicked_add(self, func, *args, **kwargs): 553 def callback_clicked_add(self, func, *args, **kwargs):
540 self._callback_add("clicked", func, args, kwargs) 554 self._callback_add("clicked", func, args, kwargs)
541 555
diff --git a/examples/elementary/test_multibuttonentry.py b/examples/elementary/test_multibuttonentry.py
index ea365d7..e57a6cd 100644
--- a/examples/elementary/test_multibuttonentry.py
+++ b/examples/elementary/test_multibuttonentry.py
@@ -16,9 +16,15 @@ SCROLL_POLICY_VERT = ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO
16 16
17counter = 0 17counter = 0
18 18
19def cb_item_selected(mbe, *args, **kwargs): 19def cb_item_selected(mbe, item):
20 # XXX: This gets called twice 20 print("ITEM SELECTED", item)
21 print(mbe) 21
22def cb_item_clicked(mbe, item):
23 print("ITEM CLICKED", item)
24
25def cb_item_longpressed(mbe, item):
26 print("ITEM LONGPRESSED", item)
27
22 28
23def cb_btn_item_prepend(btn, mbe): 29def cb_btn_item_prepend(btn, mbe):
24 global counter 30 global counter
@@ -75,6 +81,8 @@ def multibuttonentry_clicked(obj, item=None):
75 mbe = MultiButtonEntry(win, size_hint_align=FILL_BOTH, 81 mbe = MultiButtonEntry(win, size_hint_align=FILL_BOTH,
76 size_hint_weight=EXPAND_BOTH, text="To: ") 82 size_hint_weight=EXPAND_BOTH, text="To: ")
77 mbe.callback_item_selected_add(cb_item_selected) 83 mbe.callback_item_selected_add(cb_item_selected)
84 mbe.callback_item_clicked_add(cb_item_clicked)
85 mbe.callback_item_longpressed_add(cb_item_longpressed)
78 mbe.part_text_set("guide", "Tap to add recipient") 86 mbe.part_text_set("guide", "Tap to add recipient")
79 mbe.filter_append(cb_filter1) 87 mbe.filter_append(cb_filter1)
80 mbe.show() 88 mbe.show()