summaryrefslogtreecommitdiff
path: root/efl/elementary/toolbar.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'efl/elementary/toolbar.pyx')
-rw-r--r--efl/elementary/toolbar.pyx29
1 files changed, 29 insertions, 0 deletions
diff --git a/efl/elementary/toolbar.pyx b/efl/elementary/toolbar.pyx
index e939c1c..03a6829 100644
--- a/efl/elementary/toolbar.pyx
+++ b/efl/elementary/toolbar.pyx
@@ -38,6 +38,8 @@ Smart callbacks one can listen to:
38- ``language,changed`` - when the program language changes. 38- ``language,changed`` - when the program language changes.
39- ``focused`` - When the toolbar has received focus. (since 1.8) 39- ``focused`` - When the toolbar has received focus. (since 1.8)
40- ``unfocused`` - When the toolbar has lost focus. (since 1.8) 40- ``unfocused`` - When the toolbar has lost focus. (since 1.8)
41- ``item,focused`` - When the toolbar item has received focus. (since 1.10)
42- ``item,unfocused`` - When the toolbar item has lost focus. (since 1.10)
41 43
42Available styles for it: 44Available styles for it:
43 45
@@ -165,6 +167,7 @@ Where to position the item in the toolbar.
165""" 167"""
166 168
167from cpython cimport PyUnicode_AsUTF8String, Py_INCREF, Py_DECREF 169from cpython cimport PyUnicode_AsUTF8String, Py_INCREF, Py_DECREF
170from libc.stdint cimport uintptr_t
168 171
169from efl.eo cimport _object_mapping_register, object_from_instance 172from efl.eo cimport _object_mapping_register, object_from_instance
170from efl.utils.conversions cimport _ctouni 173from efl.utils.conversions cimport _ctouni
@@ -206,6 +209,10 @@ ELM_TOOLBAR_ITEM_SCROLLTO_LAST = enums.ELM_TOOLBAR_ITEM_SCROLLTO_LAST
206 209
207import traceback 210import traceback
208 211
212def _cb_object_item_conv(uintptr_t addr):
213 cdef Elm_Object_Item *it = <Elm_Object_Item *>addr
214 return _object_item_to_python(it)
215
209cdef void _toolbar_item_state_callback(void *data, Evas_Object *obj, void *event_info) with gil: 216cdef void _toolbar_item_state_callback(void *data, Evas_Object *obj, void *event_info) with gil:
210 cdef ToolbarItemState state = <object>data 217 cdef ToolbarItemState state = <object>data
211 cdef ToolbarItem item = ToolbarItem.__new__(ToolbarItem) 218 cdef ToolbarItem item = ToolbarItem.__new__(ToolbarItem)
@@ -1153,6 +1160,28 @@ cdef class Toolbar(LayoutClass):
1153 def callback_unfocused_del(self, func): 1160 def callback_unfocused_del(self, func):
1154 self._callback_del("unfocused", func) 1161 self._callback_del("unfocused", func)
1155 1162
1163 def callback_item_focused_add(self, func, *args, **kwargs):
1164 """When the toolbar item has received focus.
1165
1166 .. versionadded:: 1.10
1167
1168 """
1169 self._callback_add_full("item,focused", _cb_object_item_conv, func, *args, **kwargs)
1170
1171 def callback_item_focused_del(self, func):
1172 self._callback_del_full("item,focused", _cb_object_item_conv, func)
1173
1174 def callback_item_unfocused_add(self, func, *args, **kwargs):
1175 """When the toolbar item has lost focus.
1176
1177 .. versionadded:: 1.10
1178
1179 """
1180 self._callback_add_full("item,unfocused", _cb_object_item_conv, func, *args, **kwargs)
1181
1182 def callback_item_unfocused_del(self, func):
1183 self._callback_del_full("item,unfocused", _cb_object_item_conv, func)
1184
1156 property scroller_policy: 1185 property scroller_policy:
1157 """ 1186 """
1158 1187