Re: How to change GTK+3 label color dynamically



I provide my code in previous emails.

This is my code now:

if(css_provider == NULL){
         css_provider = gtk_css_provider_new();

         gtk_style_context_add_provider 
(gtk_widget_get_style_context(GTK_WIDGET(gtk_builder_get_object(builder,"window_Main"))),
                 GTK_STYLE_PROVIDER (css_provider),
                 GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
         g_object_unref(css_provider);

     }
     gtk_css_provider_load_from_data (css_provider,"#label_Sensors { 
color: red; }",-1,NULL);


On 16-03-2017 12:41, Tilo Villwock wrote:
Am Donnerstag, den 16.03.2017, 11:58 +0000 schrieb Rúben Rodrigues:
Hi,

This is what i have, and don't works...
The code I provided works. What GTK3 version are you using? Also nobody
will be able to help you if you don't show us your code.

--Tilo



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]