application/main.c

changeset 433
605bb5dc34f1
parent 429
0921f8a5d535
child 436
222205801430
--- a/application/main.c	Sat Jan 04 16:38:48 2025 +0100
+++ b/application/main.c	Sun Jan 05 10:10:47 2025 +0100
@@ -547,6 +547,7 @@
 typedef struct WData {
     UiString *path;
     UiList *list;
+    UiInteger *spinner;
 } WData;
 
 
@@ -587,6 +588,7 @@
     WData *wdata = ui_malloc(obj->ctx, sizeof(WData));
     wdata->path = ui_string_new(obj->ctx, NULL);
     wdata->list = ui_list_new(obj->ctx, NULL);
+    wdata->spinner = ui_int_new(obj->ctx, NULL);
     obj->window = wdata;
     
     ui_list_append(wdata->list, "List Item 1");
@@ -596,13 +598,18 @@
     
     ui_button(obj, .label = "Add Menu Item", .onclick = action_button, .name = "mybutton1");
     ui_button(obj, .label = "Add List Item", .onclick = action_button2);
-    ui_progressbar(obj, .name = "pb");
+    ui_hbox0(obj) {
+        ui_progressbar(obj, .name = "pb", .fill = UI_ON);
+        ui_progressspinner(obj, .value = wdata->spinner);
+    }
     ui_listview(obj, .list = wdata->list, .fill = UI_ON, .multiselection = TRUE,
             .onactivate = action_listevent, .onactivatedata = "activate",
             .onselection = action_listevent, .onselectiondata = "selection");
     
     
     ui_show(obj);
+    
+    ui_set(wdata->spinner, 1);
 }
 
 void action_test(UiEvent *event, void *data) {

mercurial