Package: gtk

Function gtk:widget-add-css-class

Lambda List

gtk:widget-add-css-class (widget class)

Arguments

widget -- a gtk:widget object
class -- a string for the style class to add, without the leading "." used for notation of style classes

Details

Adds class to the widget. After calling this function, the style of the widget will match for class, after the CSS matching rules.

Examples

Get the CSS style classes, add and remove a CSS style class:
(defvar dialog (make-instance 'gtk:about-dialog)) => DIALOG
(gtk:widget-css-classes dialog)
=> ("background" "csd" "aboutdialog")
(gtk:widget-add-css-class dialog "mystyle")
(gtk:widget-css-classes dialog)
=> ("background" "csd" "aboutdialog" "mystyle")
(gtk:widget-remove-css-class dialog "mystyle")
(gtk:widget-css-classes dialog)
=> ("background" "csd" "aboutdialog")    
 

See also

2025-2-15