Re: How to change GTK+3 label color dynamically



You are right. I don't know why don't works before, because I had 
already tested and doesn't work... BU apparently now works with 
gdk_screen_get_default();

THanks for your help.



On 16-03-2017 14:07, Tilo Villwock wrote:
Am Donnerstag, den 16.03.2017, 13:50 +0000 schrieb Rúben Rodrigues:
I get this error:

gtk-CRITICAL **: gtk_style_context_add_provider_for_screen:
assertion
'GDK_IS_SCREEN (screen)' failed

COde:
gtk_style_context_add_provider_for_screen(gtk_widget_get_style_contex
t(GTK_WIDGET(gtk_builder_get_object(builder,"window_Main"))),
              GTK_STYLE_PROVIDER (css_provider),
              G_MAXUINT);
Of course you do. The first argument is meant to be a GdkScreen object.
Which makes me wonder if you even read the documentation. Anyways, you
can obtain the object by invoking

     gdk_screen_get_default()

and the last argument is supposed to be a priority constant like

     GTK_STYLE_PROVIDER_PRIORITY_APPLICATION

Look them up. I'd also recommend installing devhelp and gtk3-docs if
you haven't already.

--Tilo



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