Re: How to change GTK+3 label color dynamically
- From: Tilo Villwock <codemusings gmail com>
- To: Rúben Rodrigues <ruben_gr live com pt>, "gtk-app-devel-list gnome org" <gtk-app-devel-list gnome org>
- Subject: Re: How to change GTK+3 label color dynamically
- Date: Thu, 16 Mar 2017 15:07:46 +0100
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]