How to set CSS rule for Label using gtkmm API (original) (raw)

September 12, 2024, 6:41am 1

Can I set this CSS rule for the label widget, without connecting external file

label
{
    caret-color: transparent;
}

some setter like set_css_value for example?
just want to make this small rule directly from C++ file

ebassi (Emmanuele Bassi) September 12, 2024, 7:50am 2

You can only load the CSS fragment into a CssProvider and assign it to the display (in GTK4) or to the screen (in GTK3). You can embed the CSS in a string and use gtk_css_provider_load_from_string(); or you can use a GResource, and keep the CSS in a separate file that gets compiled into your binary.

system (system) Closed October 12, 2024, 7:50am 3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.