ui/common/context.c

changeset 775
c39e71be2e18
parent 774
4531a342c5b3
child 793
f33f05cd0548
--- a/ui/common/context.c	Tue Sep 23 17:40:40 2025 +0200
+++ b/ui/common/context.c	Wed Sep 24 21:00:42 2025 +0200
@@ -542,6 +542,9 @@
 }
 
 void ui_widget_set_groups(UiContext *ctx, UIWIDGET widget, ui_enablefunc enable, ...) {
+    if(enable == NULL) {
+        enable = (ui_enablefunc)ui_set_enabled;
+    }
     // get groups
     CxList *groups = cxArrayListCreate(cxDefaultAllocator, NULL, sizeof(int), 16);
     va_list ap;
@@ -558,6 +561,9 @@
 }
 
 void ui_widget_set_groups2(UiContext *ctx, UIWIDGET widget, ui_enablefunc enable, int *groups, int ngroups) {
+    if(enable == NULL) {
+        enable = (ui_enablefunc)ui_set_enabled;
+    }
     CxList *ls = cxArrayListCreate(cxDefaultAllocator, NULL, sizeof(int), ngroups);
     for(int i=0;i<ngroups;i++) {
         cxListAdd(ls, groups+i);

mercurial