diff --git a/test/test_progressbar.c b/test/test_progressbar.c index b3772951..39be6afc 100644 --- a/test/test_progressbar.c +++ b/test/test_progressbar.c @@ -1,10 +1,10 @@ - //测试进度条部件的示例程序 #include #include LC_LCUI_H #include LC_WIDGET_H #include LC_WINDOW_H #include LC_GRAPHICS_H +#include LC_LABEL_H #include LC_RES_H #include LC_WORK_H #include LC_MISC_H @@ -14,47 +14,56 @@ #include #include #include -void *change_progress(void *arg) -/* 功能:动态改变label部件的文本内容 */ + +void *change_progress_1(void *arg) +/* 功能:动态改变进度条部件的数据 */ { - int i, max; - max = 100; + int i, max = 100; + LCUI_Widget *label; LCUI_Widget *widget = (LCUI_Widget *)arg; /* 转换类型 */ + + label = Create_Widget("label"); + Widget_Container_Add(widget, label); + label->set_align(label, ALIGN_MIDDLE_CENTER, Pos(0,0)); + label->show(label); Set_ProgressBar_Max_Value(widget, max); /* 最大值 */ srand(time(NULL)); for(i=0; iset_align(label, ALIGN_MIDDLE_CENTER, Pos(0,0)); + label->show(label); + Set_ProgressBar_Max_Value(widget, max); + srand(time(NULL)); + for(i=0; i