diff --git a/efl/elementary/gengrid_item.pxi b/efl/elementary/gengrid_item.pxi index bc9013f..a535bf5 100644 --- a/efl/elementary/gengrid_item.pxi +++ b/efl/elementary/gengrid_item.pxi @@ -319,11 +319,11 @@ cdef class GengridItem(ObjectItem): def tooltip_content_cb_set(self, func, *args, **kargs): """Set the content to be shown in the tooltip object - Setup the tooltip to object. The object can have only one tooltip, - so any previews tooltip data is removed. ``func(args, kargs)`` will - be called every time that need show the tooltip and it should return a - valid Evas_Object. This object is then managed fully by tooltip system - and is deleted when the tooltip is gone. + Setup the tooltip to object. The object can have only one tooltip, so + any previews tooltip data is removed. ``func(owner, item, tooltip, + args, kargs)`` will be called every time that need show the tooltip and + it should return a valid Evas_Object. This object is then managed fully + by tooltip system and is deleted when the tooltip is gone. :param func: Function to be create tooltip content, called when need show tooltip. @@ -334,9 +334,9 @@ cdef class GengridItem(ObjectItem): cdef void *cbdata - data = (func, self, args, kargs) + data = (func, args, kargs) Py_INCREF(data) - # FIXME: refleak? + # DECREF is in data_del_cb cbdata = data elm_gengrid_item_tooltip_content_cb_set(self.item, _tooltip_item_content_create, diff --git a/efl/elementary/genlist_item.pxi b/efl/elementary/genlist_item.pxi index 96daebe..a5f84cc 100644 --- a/efl/elementary/genlist_item.pxi +++ b/efl/elementary/genlist_item.pxi @@ -399,11 +399,11 @@ cdef class GenlistItem(ObjectItem): def tooltip_content_cb_set(self, func, *args, **kargs): """Set the content to be shown in the tooltip object - Setup the tooltip to object. The object can have only one tooltip, - so any previews tooltip data is removed. ``func(args,kargs)`` will - be called every time that need show the tooltip and it should return - a valid Evas_Object. This object is then managed fully by tooltip - system and is deleted when the tooltip is gone. + Setup the tooltip to object. The object can have only one tooltip, so + any previews tooltip data is removed. ``func(owner, item, tooltip, + args, kargs)`` will be called every time that need show the tooltip and + it should return a valid Evas_Object. This object is then managed fully + by tooltip system and is deleted when the tooltip is gone. :param func: Function to be create tooltip content, called when need show tooltip. @@ -414,8 +414,9 @@ cdef class GenlistItem(ObjectItem): cdef void *cbdata - data = (func, self, args, kargs) + data = (func, args, kargs) Py_INCREF(data) + # DECREF is in data_del_cb cbdata = data elm_genlist_item_tooltip_content_cb_set(self.item, _tooltip_item_content_create, diff --git a/efl/elementary/object_item.pyx b/efl/elementary/object_item.pyx index 02e8a31..1e81dd6 100644 --- a/efl/elementary/object_item.pyx +++ b/efl/elementary/object_item.pyx @@ -477,12 +477,11 @@ cdef class ObjectItem(object): def tooltip_content_cb_set(self, func, *args, **kargs): """Set the content to be shown in the tooltip object - Setup the tooltip to object. The object can have only one tooltip, - so any previews tooltip data is removed. ``func(owner, tooltip, - args, kargs)`` will be called every time that need show the tooltip - and it should return a valid Evas_Object. This object is then - managed fully by tooltip system and is deleted when the tooltip is - gone. + Setup the tooltip to object. The object can have only one tooltip, so + any previews tooltip data is removed. ``func(owner, item, tooltip, + args, kargs)`` will be called every time that need show the tooltip and + it should return a valid Evas_Object. This object is then managed fully + by tooltip system and is deleted when the tooltip is gone. :param func: Function to be create tooltip content, called when need show tooltip. @@ -495,8 +494,8 @@ cdef class ObjectItem(object): cdef void *cbdata data = (func, args, kargs) - # FIXME: refleak Py_INCREF(data) + # DECREF is in data_del_cb cbdata = data elm_object_item_tooltip_content_cb_set(self.item, _tooltip_item_content_create, cbdata, _tooltip_item_data_del_cb) diff --git a/efl/elementary/tooltips.pxi b/efl/elementary/tooltips.pxi index 50f9947..ea57ed0 100644 --- a/efl/elementary/tooltips.pxi +++ b/efl/elementary/tooltips.pxi @@ -42,7 +42,7 @@ cdef Evas_Object *_tooltip_item_content_create(void *data, Evas_Object *o, Evas_ tooltip = object_from_instance(t) item = _object_item_to_python(it) (func, args, kargs) = data - ret = func(obj, item, *args, **kargs) + ret = func(obj, item, tooltip, *args, **kargs) if not ret: return NULL return ret.obj