ui/gtk/toolkit.c

branch
newapi
changeset 313
b679cc6059ab
parent 310
4918f9132552
child 314
d96ba820083a
equal deleted inserted replaced
312:3f2b3d15668b 313:b679cc6059ab
382 } 382 }
383 383
384 384
385 385
386 #endif 386 #endif
387
388 void ui_set_name_and_style(GtkWidget *widget, const char *name, const char *style_classes) {
389 if(name) {
390 gtk_widget_set_name(widget, name);
391 }
392 if(style_classes) {
393 cxstring *cls = NULL;
394 size_t numClasses = cx_strsplit_a(cxDefaultAllocator, cx_str(style_classes), CX_STR(" "), 128, &cls);
395 for(int i=0;i<numClasses;i++) {
396 cxmutstr m = cx_strdup(cls[i]);
397 gtk_widget_add_css_class(widget, m.ptr);
398 free(m.ptr);
399 }
400 free(cls);
401
402 }
403 }

mercurial