Thank you. I suspect that the problem of “setting” CSS classes instead of “adding” them would be that with your solution possible CSS classes added by the _init() function of GtkButton would be overwritten. Isn’t that correct?
Yes, possibly. But I hope the GTK developers will consider adding a gtk_widget_add_css_classes() and also a gtk_widget_remove_css_classes() function (also variadic). If, as it seems, GTK mimics the HTML DOM and JavaScript, there we have
And similarly, for a remove_css_classes(). In general, though:
we don’t add this kind of C convenience API unless there are multiple applications clamouring for it
it’s easy to open-code this functionality
it’s rare for application code to add more than one class at a time; that’s usually happens at instance initialisation, which is better handled through a UI template
An array of strings would also work! I don’t know if C convenience APIs are in general necessary, but if they are, CSS classes are something so ubiquitous and deeply rooted in modern GTK programming that this is definitely one place where to have them. For the same reason, personally, I would consider adding both types of functions (variadic and single array argument) – but this is just my opinion.