Hi!

Updating to the latest svn, solved all my issues, it works like a charm.

However now Im fighting with the problem of obtaining the cursor
position of the entry.

For this I also cooked some small, trivial patches for python-elementary
bindings, namely:
entry_cursor_begin_set()
entry_cursor_end_set()
entry_cursor_content_get()

Also a really tiny documentation fix, what is entry_cursor_content_get.

Playing a full day already, I cant figure out how to obtain the cursor
position of an elementary.entry.

I want to achieve, when the cursor is at the last character, and you
push the right arrow it would automatically jump to the next entry.
(and when you at the first char, pushing the left key, would jump
to the previous entry)

I can also implement some really hackish bookkeeping code,
so creating a python class which observes the entry, and I
connect every key_press to this class, so it observes how the entry's
content changes, and fire the focus() call, when it is required.

Im pretty sure, there are some more elegant way to do is.

(also with cursor_content_get(), Im knowing the char where the
cursor stands, just the problem is if the entry contains the same
char multiple times, it will jump in the middle of the entry(ex: Muhahahaw)).

Any ideas?

Best regards,
 Laszlo


ps: I attach the patches as text too:

 svn diff -x -up TMP/st/elementary/src/lib/elm_entry.c
Index: TMP/st/elementary/src/lib/elm_entry.c
===================================================================
--- TMP/st/elementary/src/lib/elm_entry.c       (revision 48604)
+++ TMP/st/elementary/src/lib/elm_entry.c       (working copy)
@@ -1893,7 +1893,7 @@ elm_entry_cursor_is_visible_format_get(const Evas_
  * TODO: fill this in
  *
  * @param obj The entry object
- * @return TODO: fill this in
+ * @return Returns the char where the cursor stands.
  *
  * @ingroup Entry
  */

 svn diff -x -up
BINDINGS/python/python-elementary/include/elementary/c_elementary.pxd
Index: BINDINGS/python/python-elementary/include/elementary/c_elementary.pxd
===================================================================
--- BINDINGS/python/python-elementary/include/elementary/c_elementary.pxd       
(revision
48604)
+++ BINDINGS/python/python-elementary/include/elementary/c_elementary.pxd       
(working
copy)
@@ -369,9 +369,12 @@ cdef extern from "Elementary.h":
     # Entry Object
     evas.c_evas.Evas_Object *elm_entry_add(evas.c_evas.Evas_Object *parent)
     void elm_entry_single_line_set(evas.c_evas.Evas_Object *obj,
evas.c_evas.Eina_Bool single_line)
+    void elm_entry_cursor_begin_set(evas.c_evas.Evas_Object *obj)
+    void elm_entry_cursor_end_set(evas.c_evas.Evas_Object *obj)
     void elm_entry_password_set(evas.c_evas.Evas_Object *obj,
evas.c_evas.Eina_Bool password)
     void elm_entry_entry_set(evas.c_evas.Evas_Object *obj, char *entry)
     char *elm_entry_entry_get(evas.c_evas.Evas_Object *obj)
+    char *elm_entry_cursor_content_get(evas.c_evas.Evas_Object *obj)
     char *elm_entry_selection_get(evas.c_evas.Evas_Object *obj)
     void elm_entry_entry_insert(evas.c_evas.Evas_Object *obj, char *entry)
     void elm_entry_line_wrap_set(evas.c_evas.Evas_Object *obj,
evas.c_evas.Eina_Bool wrap)


svn diff -x -up
BINDINGS/python/python-elementary/elementary/elementary.c_elementary_entry.pxi
Index: 
BINDINGS/python/python-elementary/elementary/elementary.c_elementary_entry.pxi
===================================================================
--- 
BINDINGS/python/python-elementary/elementary/elementary.c_elementary_entry.pxi  
    (revision
48604)
+++ 
BINDINGS/python/python-elementary/elementary/elementary.c_elementary_entry.pxi  
    (working
copy)
@@ -120,6 +120,12 @@ cdef class Entry(Object):
     def callback_unfocused_del(self, func):
         self._callback_del("unfocused", func)

+    def cursor_begin_set(self):
+        elm_entry_cursor_begin_set(self.obj)
+
+    def cursor_end_set(self):
+        elm_entry_cursor_end_set(self.obj)
+
     def single_line_set(self, single_line):
         elm_entry_single_line_set(self.obj, single_line)

@@ -132,6 +138,9 @@ cdef class Entry(Object):
     def entry_get(self):
         return elm_entry_entry_get(self.obj)

+    def cursor_content_get(self):
+        return elm_entry_cursor_content_get(self.obj)
+
     def selection_get(self):
         cdef char* str
         str = elm_entry_selection_get(self.obj)
Index: TMP/st/elementary/src/lib/elm_entry.c
===================================================================
--- TMP/st/elementary/src/lib/elm_entry.c	(revision 48604)
+++ TMP/st/elementary/src/lib/elm_entry.c	(working copy)
@@ -1893,7 +1893,7 @@ elm_entry_cursor_is_visible_format_get(const Evas_
  * TODO: fill this in
  *
  * @param obj The entry object
- * @return TODO: fill this in
+ * @return Returns the char where the cursor stands.
  *
  * @ingroup Entry
  */
Index: BINDINGS/python/python-elementary/include/elementary/c_elementary.pxd
===================================================================
--- BINDINGS/python/python-elementary/include/elementary/c_elementary.pxd	(revision 48604)
+++ BINDINGS/python/python-elementary/include/elementary/c_elementary.pxd	(working copy)
@@ -369,9 +369,12 @@ cdef extern from "Elementary.h":
     # Entry Object
     evas.c_evas.Evas_Object *elm_entry_add(evas.c_evas.Evas_Object *parent)
     void elm_entry_single_line_set(evas.c_evas.Evas_Object *obj, evas.c_evas.Eina_Bool single_line)
+    void elm_entry_cursor_begin_set(evas.c_evas.Evas_Object *obj)
+    void elm_entry_cursor_end_set(evas.c_evas.Evas_Object *obj)
     void elm_entry_password_set(evas.c_evas.Evas_Object *obj, evas.c_evas.Eina_Bool password)
     void elm_entry_entry_set(evas.c_evas.Evas_Object *obj, char *entry)
     char *elm_entry_entry_get(evas.c_evas.Evas_Object *obj)
+    char *elm_entry_cursor_content_get(evas.c_evas.Evas_Object *obj)
     char *elm_entry_selection_get(evas.c_evas.Evas_Object *obj)
     void elm_entry_entry_insert(evas.c_evas.Evas_Object *obj, char *entry)
     void elm_entry_line_wrap_set(evas.c_evas.Evas_Object *obj, evas.c_evas.Eina_Bool wrap)
Index: BINDINGS/python/python-elementary/elementary/elementary.c_elementary_entry.pxi
===================================================================
--- BINDINGS/python/python-elementary/elementary/elementary.c_elementary_entry.pxi	(revision 48604)
+++ BINDINGS/python/python-elementary/elementary/elementary.c_elementary_entry.pxi	(working copy)
@@ -120,6 +120,12 @@ cdef class Entry(Object):
     def callback_unfocused_del(self, func):
         self._callback_del("unfocused", func)
 
+    def cursor_begin_set(self):
+        elm_entry_cursor_begin_set(self.obj)
+
+    def cursor_end_set(self):
+        elm_entry_cursor_end_set(self.obj)
+    
     def single_line_set(self, single_line):
         elm_entry_single_line_set(self.obj, single_line)
 
@@ -132,6 +138,9 @@ cdef class Entry(Object):
     def entry_get(self):
         return elm_entry_entry_get(self.obj)
 
+    def cursor_content_get(self):
+        return elm_entry_cursor_content_get(self.obj)
+    
     def selection_get(self):
         cdef char* str
         str = elm_entry_selection_get(self.obj)
------------------------------------------------------------------------------
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to