Attached is a patch which makes the callback receive event_info with a
conversion function. I used the old AnchorBlock widget as reference. It
still doesn't open Hover, should this be done in the conversion code?

Wed, 4 Apr 2012 13:48:28 +0300
Kai Huuhko <kai.huu...@gmail.com> kirjoitti:

> Attached is a simple test to demonstrate this.
> 
> I get this output:
> 
> Entry object is Entry(name=%r, geometry=(8, 192, 384, 30), color=(255,
> 255, 255, 255), layer=0, clip=True, visible=True)
> We should have event_info here: ()
> 
> Wed, 4 Apr 2012 09:36:26 +0900
> Daniel Juyung Seo <seojuyu...@gmail.com> kirjoitti:
> 
> > Thanks for the report but can you attach any test code?
> > I can't reproduce it and at least I got event_info with
> > "anchor,clicked" callback in entry.
> > Thanks.
> > 
> > Daniel Juyung Seo (SeoZ)
> > 
> > On Wed, Apr 4, 2012 at 1:15 AM, Kai Huuhko <kai.huu...@gmail.com>
> > wrote:
> > > The event signal for "anchor, clicked" isn't passing event_info to
> > > the callback. I believe callback_anchor_clicked_add should have a
> > > conversion function and use it with _callback_add_full.
> > >
> > > This seems to be the case for the other anchor signals as well.
> > >

diff --git a/python-elementary/elementary/elementary.c_elementary_entry.pxi b/python-elementary/elementary/elementary.c_elementary_entry.pxi
index 5f3ff99..d6c0f93 100644
--- a/python-elementary/elementary/elementary.c_elementary_entry.pxi
+++ b/python-elementary/elementary/elementary.c_elementary_entry.pxi
@@ -30,6 +30,25 @@ def Entry_utf8_to_markup(str):
         return None
     return string
 
+class EntryAnchorInfo:
+    def __init__(self):
+        self.name = None
+        self.button = 0
+        self.x = 0
+        self.y = 0
+        self.w = 0
+        self.h = 0
+
+def _entryanchor_conv(long addr):
+    cdef Elm_Entry_Anchor_Info *ei = <Elm_Entry_Anchor_Info *>addr
+    eai = EntryAnchorInfo()
+    eai.name = ei.name
+    eai.button = ei.button
+    eai.x = ei.x
+    eai.y = ei.y
+    eai.w = ei.w
+    eai.h = ei.h
+    return eai
 
 cdef class Entry(Object):
     def __init__(self, c_evas.Object parent):
@@ -91,10 +110,12 @@ cdef class Entry(Object):
         self._callback_del("cursor,changed", func)
 
     def callback_anchor_clicked_add(self, func, *args, **kwargs):
-        self._callback_add("anchor,clicked", func, *args, **kwargs)
+        return self._callback_add_full("anchor,clicked", _entryanchor_conv,
+                                       func, *args, **kwargs)
 
     def callback_anchor_clicked_del(self, func):
-        self._callback_del("anchor,clicked", func)
+        return self._callback_del_full("anchor,clicked", _entryanchor_conv,
+                                       func)
 
     def callback_activated_add(self, func, *args, **kwargs):
         self._callback_add("activated", func, *args, **kwargs)
diff --git a/python-elementary/include/elementary/c_elementary.pxd b/python-elementary/include/elementary/c_elementary.pxd
index 1a49c50..005f929 100644
--- a/python-elementary/include/elementary/c_elementary.pxd
+++ b/python-elementary/include/elementary/c_elementary.pxd
@@ -181,7 +181,13 @@ cdef extern from "Elementary.h":
         ELM_BUBBLE_POS_BOTTOM_LEFT
         ELM_BUBBLE_POS_BOTTOM_RIGHT
 
-    ctypedef struct Elm_Entry_Anchor_Info
+    ctypedef struct Elm_Entry_Anchor_Info:
+        char *name
+        int   button
+        evas.c_evas.Evas_Coord x
+        evas.c_evas.Evas_Coord y
+        evas.c_evas.Evas_Coord w
+        evas.c_evas.Evas_Coord h
 
     ctypedef char *(*GenlistItemLabelGetFunc)(void *data, evas.c_evas.Evas_Object *obj, const_char_ptr part)
     ctypedef evas.c_evas.Evas_Object *(*GenlistItemIconGetFunc)(void *data, evas.c_evas.Evas_Object *obj, const_char_ptr part)
-- 
1.7.9

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to