Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto
Dir : e17/proto/etk/src/lib Modified Files: etk_entry.c etk_entry.h Log Message: - entry now supports setting the text prior to realization =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_entry.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- etk_entry.c 9 Mar 2006 13:29:00 -0000 1.14 +++ etk_entry.c 12 Mar 2006 09:21:50 -0000 1.15 @@ -83,10 +83,15 @@ */ void etk_entry_text_set(Etk_Entry *entry, const char *text) { - if (!entry || !entry->editable_object) + if (!entry) return; - etk_editable_text_object_text_set(entry->editable_object, text); - etk_signal_emit(_etk_entry_signals[ETK_ENTRY_TEXT_CHANGED_SIGNAL], ETK_OBJECT(entry), NULL); + if(!entry->editable_object) + entry->text = strdup(text); + else + { + etk_editable_text_object_text_set(entry->editable_object, text); + etk_signal_emit(_etk_entry_signals[ETK_ENTRY_TEXT_CHANGED_SIGNAL], ETK_OBJECT(entry), NULL); + } } /** @@ -175,6 +180,7 @@ entry->editable_object = NULL; entry->is_password = ETK_FALSE; entry->password_text = NULL; + entry->text = NULL; etk_signal_connect("realize", ETK_OBJECT(entry), ETK_CALLBACK(_etk_entry_realize_cb), NULL); etk_signal_connect("unrealize", ETK_OBJECT(entry), ETK_CALLBACK(_etk_entry_unrealize_cb), NULL); @@ -239,6 +245,12 @@ entry = ETK_ENTRY(entry_widget); entry->editable_object = etk_editable_text_object_add(evas); + if(entry->text != NULL) + { + etk_editable_text_object_text_set(entry->editable_object, entry->text); + free(entry->text); + entry->text = NULL; + } evas_object_show(entry->editable_object); etk_widget_theme_object_swallow(entry_widget, "text_area", entry->editable_object); } =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_entry.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- etk_entry.h 25 Feb 2006 03:35:56 -0000 1.4 +++ etk_entry.h 12 Mar 2006 09:21:50 -0000 1.5 @@ -32,6 +32,7 @@ Etk_Bool is_password; char *password_text; + char *text; }; Etk_Type *etk_entry_type_get(); ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs