Package: gtk
Class gtk:css-provider
Superclassesgtk:style-provider, gobject:object, common-lisp:standard-object, common-lisp:t Documented Subclasses
None
Direct Slots
None
Details The gtk:css-provider object is an object implementing the gtk:style-provider interface.
It is able to parse CSS-like input in order to style widgets. An application can make GTK parse a specific CSS style sheet by calling the gtk:css-provider-load-from-file or gtk:css-provider-load-from-resource functions and adding the provider with the gtk:style-context-add-provider or gtk:style-context-add-provider-for-display functions. In addition, certain files will be read when GTK is initialized. First, the $XDG_CONFIG_HOME/gtk-4.0/gtk.css file is loaded if it exists. Then, GTK loads the first existing file among XDG_DATA_HOME/themes/THEME/gtk-VERSION/gtk-VARIANT.css, $HOME/.themes/THEME/gtk-VERSION/gtk:VARIANT.css, $XDG_DATA_DIRS/themes/THEME/gtk-VERSION/gtk-VARIANT.css and DATADIR/share/themes/THEME/gtk-VERSION/gtk-VARIANT.css, where THEME is the name of the current theme, see the gtk-icon-theme-name setting setting, VARIANT is the variant to load, see the gtk-application-prefer-dark-theme setting, DATADIR is the prefix configured when GTK was compiled (unless overridden by the GTK_DATA_PREFIX environment variable), and VERSION is the GTK version number. If no file is found for the current version, GTK tries older versions all the way back to 4.0. To track errors while loading CSS, connect to the "parsing-error" signal. Signal DetailsThe "parsing-error" signallambda (provider section error) :run-last
Note that this signal may be emitted at any time as the CSS provider may opt to defer parsing parts or all of the input to a later time than when a loading function was called. | Returned byInherited Slot Access FunctionsSee also |
2025-1-11