浏览代码

fix textbox_set_value issue when text is "".

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@678 bbd45198-f89e-11dd-88c7-29a3b14d5316
bernard.xiong 15 年之前
父节点
当前提交
7df7dafe70
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      components/rtgui/widgets/textbox.c

+ 2 - 0
components/rtgui/widgets/textbox.c

@@ -326,6 +326,8 @@ void rtgui_textbox_set_value(struct rtgui_textbox* box, const char* text)
 		if (box->line_length > rt_strlen(text) + 1)
 		{
 			rt_memcpy(box->text, text, rt_strlen(text) + 1);
+			/* set current position */
+			box->position = 0;
 			return;
 		}
 		else