I've been attempting to set an image as the background of a GtkBox using a CSS provider, and also customize the style of some label text, but no matter what I try, nothing seems to work.
Below is the content of my custom.css file:
GtkBox#Home_PrincipalScreen_table{
background-image: url("background.png");
}
GtkLabel#Home_Cooling_Tunnel1_Cooler_label1{
color: white;
}
GtkLabel#label_Avg_Temp_value{
color: red;
font-family: Segoe UI;
font-size: 25px;
}
GtkButton{
color: blue;
font-size: 25px;
}
And here is a snippet from my .c file showing how I'm loading the CSS file:
GFile *file= g_file_new_for_path("custom.css");
GtkCssProvider *css_provider = gtk_css_provider_new();
if(!gtk_css_provider_load_from_file(css_provider, file, &error))
{
g_warning( "%s", error->message );
g_free( error );
return( 1 );
}
gtk_style_context_add_provider_for_screen(gdk_screen_get_default(), css_provider, GTK_STYLE_PROVIDER_PRIORITY_USER);
An update on the issue:
While widgets like GtkButton are changing their properties according to the CSS, specific widgets such as Home_PrincipalScreen_table are not responding to the styling.
Can anyone point out what might be wrong with my code?