流星悟语 发表于 2015-8-22 18:08:01

Tizen开发基本输入小部件代码

这个代码片段演示了如何创建一个条目小部件和执行一些基本的操作。
Evas_Object* entry = elm_entry_add(ad->win);
evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);

//single line
elm_entry_single_line_set(entry, EINA_TRUE);

//set entry text
elm_entry_entry_set(entry, "text");

//insert text at current cursor position (here beginning)
elm_entry_entry_insert(entry, "sample ");

//set entry to password mode
elm_entry_password_set(entry, EINA_TRUE);

//disable entry editing
elm_entry_editable_set(entry, EINA_FALSE);

evas_object_show(entry);
elm_object_content_set(ad->conform, entry);

//get entry text
const char* text = elm_entry_entry_get(entry);
dlog_print(DLOG_DEBUG, LOG_TAG, "Entry text: %s", text);
页: [1]
查看完整版本: Tizen开发基本输入小部件代码