summaryrefslogtreecommitdiff
path: root/components/rtgui/widgets
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2010-04-28 15:38:02 +0000
committerbernard.xiong <[email protected]>2010-04-28 15:38:02 +0000
commit7df7dafe7038c51fa84572ec8276e847e85137b5 (patch)
tree480ca669976299c4957394117161674f47ae3e29 /components/rtgui/widgets
parent298a15f31adcba81e920933d0f05549e3cbfab3e (diff)
fix textbox_set_value issue when text is "".
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@678 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/rtgui/widgets')
-rw-r--r--components/rtgui/widgets/textbox.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/components/rtgui/widgets/textbox.c b/components/rtgui/widgets/textbox.c
index 9fd86b7efd..2bde9cebbe 100644
--- a/components/rtgui/widgets/textbox.c
+++ b/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