From 7df7dafe7038c51fa84572ec8276e847e85137b5 Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Wed, 28 Apr 2010 15:38:02 +0000 Subject: [PATCH] fix textbox_set_value issue when text is "". git-svn-id: https://rt-thread.googlecode.com/svn/trunk@678 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- components/rtgui/widgets/textbox.c | 2 ++ 1 file changed, 2 insertions(+) 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 -- GitLab