|
基本部件的进度与计时
这段代码演示了如何使用基本初等进度部件。
- // update progressbar, 1% for each call
- static Eina_Bool progressbar_value_set(void *data) {
- Evas_Object *progressbar = data;
- double progress = elm_progressbar_value_get(progressbar);
- if (progress < 1.0) {
- progress += 0.01;
- elm_progressbar_value_set(progressbar, progress);
- return ECORE_CALLBACK_RENEW;
- }
- return ECORE_CALLBACK_CANCEL;
- }
- static void progressbar_test(appdata_s *ad) {
-
- // create a progressbar
- Evas_Object *progressbar = elm_progressbar_add(ad->win);
- evas_object_resize(progressbar, 200, 50);
- evas_object_move(progressbar, 100, 100);
-
- // set its style to a regular progressbar
- elm_object_style_set(progressbar, "progressbar");
-
- evas_object_show(progressbar);
- elm_progressbar_value_set(progressbar, 0);
- // add a timer to change progressbar values (demo)
- ecore_timer_add(0.1, progressbar_value_set, progressbar);
- }
复制代码
|
|