|
各位大侠好,小弟想实现按钮触发进度条显示,通过参考example,得出一下程序,刚学的RTGUI,请各位高手指点一下。
以下程序问题一:进度条不走
问题二:在原有界面的上面弹出一条进度条,其他的不显示
可能我对GUI的各个结构还不是很了解,正在研究中。请帮忙解答一下,谢谢了。
static void demo_view_progressbar(rtgui_widget_t* widget, struct rtgui_event* event)
{
rtgui_workbench_t *workbench;
rtgui_view_t *view;
rtgui_rect_t rect;
rtgui_label_t *label;
/* 获得顶层的workbench */
workbench = RTGUI_WORKBENCH(rtgui_widget_get_toplevel(widget));
rtgui_widget_get_rect(RTGUI_WIDGET(workbench), &rect);
/* create a demo view */
view = demo_view(workbench, "ProgressBar View");
/* get demo view rect */
demo_view_get_rect(view, &rect);
label = rtgui_label_create("水平进度条:");
rtgui_container_add_child(RTGUI_CONTAINER(view), RTGUI_WIDGET(label));
rect.x1 += 5; rect.x2 -= 5;
rect.y1 += 5; rect.y2 = rect.y1 + 18;
rtgui_widget_set_rect(RTGUI_WIDGET(label), &rect);
rect.y1 += 20; rect.y2 = rect.y1 + 18;
hbar = rtgui_progressbar_create(RTGUI_HORIZONTAL, 100, &rect);
rtgui_container_add_child(RTGUI_CONTAINER(view), RTGUI_WIDGET(hbar));
bar_timer = rtgui_timer_create(50, RT_TIMER_FLAG_PERIODIC,
progressbar_timeout, RT_NULL);
rtgui_timer_start(bar_timer);
/* 删除 文件列表 视图 */
rtgui_view_destroy(RTGUI_VIEW(view));
rtgui_view_show(_view, RT_FALSE);
} |
阿莫论坛20周年了!感谢大家的支持与爱护!!
曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……
|