ui/motif/toolbar.c

changeset 153
ee49d1852a5f
parent 117
38c53b8a6139
child 157
0b33b9396851
--- a/ui/motif/toolbar.c	Sun Jan 21 12:13:09 2018 +0100
+++ b/ui/motif/toolbar.c	Sun Jul 01 19:03:26 2018 +0200
@@ -149,7 +149,7 @@
 void ui_toolbar_combobox(
         char *name,
         UiList *list,
-        ui_model_getvalue_f getvalue,
+        ui_getvaluefunc getvalue,
         ui_callback f,
         void *udata)
 {
@@ -175,7 +175,7 @@
 void ui_toolbar_combobox_nv(
         char *name,
         char *listname,
-        ui_model_getvalue_f getvalue,
+        ui_getvaluefunc getvalue,
         ui_callback f,
         void *udata)
 {
@@ -334,13 +334,13 @@
 }
 
 void add_toolbar_combobox(Widget tb, UiToolbarComboBox *item, UiObject *obj) {
-    UiListPtr *listptr = ucx_mempool_malloc(
-                obj->ctx->mempool,
-                sizeof(UiListPtr));
     UiListView *listview = ucx_mempool_malloc(
                 obj->ctx->mempool,
                 sizeof(UiListView));
-    listptr->list = item->list;
+    
+    UiVar *var = ucx_mempool_malloc(obj->ctx->mempool, sizeof(UiVar));
+    var->value = item->list;
+    var->type = UI_VAR_SPECIAL;
     
     Arg args[8];
     XtSetArg(args[0], XmNshadowThickness, 1);
@@ -350,16 +350,11 @@
     Widget combobox = XmCreateDropDownList(tb, "toolbar_combobox", args, 4);
     XtManageChild(combobox);
     listview->widget = combobox;
-    listview->list = listptr;
+    listview->list = var;
     listview->getvalue = item->getvalue;
     
     ui_listview_update(NULL, listview);
     
-    listptr->list->observers = ui_add_observer(
-            listptr->list->observers,
-            (ui_callback)ui_listview_update,
-            listview);
-    
     if(item->callback) {
         // TODO:
         

mercurial