Package: gtk

Function gtk:style-context-add-provider-for-display

Lambda List

gtk:style-context-add-provider-for-display (display provider &optional priority)

Arguments

display -- a gdk:display object
provider -- a gtk:style-provider object
priority -- an optional unsigned integer with the priority of the style provider, the default value is gtk:+priority-application+

Details

Adds a global style provider to the display, which will be used in style construction for all style contexts under the display. GTK uses this to make styling information from the gtk:settings object available.

Examples

Change the color and the font in a text view: Create a provider, load CSS into the provider, add the style class and the provider to the parent window.
(let ((provider (gtk:css-provider-new)))
  (gtk:css-provider-load-from-data provider
                                   ".viewstyle textview {
                                      color : Green;
                                      font : 20px Purisa; }")
  (gtk:widget-add-css-class window "viewstyle")
  (gtk:style-context-add-provider-for-display (gtk:widget-display window)
                                              provider)
  ... )    

Notes

If both priorities are the same, a style provider object added through the gtk:style-context-add-provider function takes precedence over another added through this function.
 

See also

2024-4-19