GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Oct 02, 2014 12:27 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: SOLVED Using gtk_style_context_add_provider with css
PostPosted: Sun Sep 15, 2013 6:45 pm 
Offline

Joined: Mon Sep 02, 2013 10:02 pm
Posts: 4
I am trying to change the font color of a GtkSpinEdit. I have the following code (fragment):

Code:
  /*
  Add styling information
  */
  GtkCssProvider *css_provider = gtk_css_provider_new();
  gtk_css_provider_load_from_data (css_provider,"#spinbutton1 {color: red;}",-1,NULL);
  GtkStyleContext *spin_button_context = gtk_widget_get_style_context (GTK_WIDGET(spinbutton1));
  gtk_style_context_add_provider  (spin_button_context, css_provider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);


My compiler (gcc 4.7.2) replies:

Quote:
main.c: In function ‘main’:
main.c:48:3: warning: passing argument 2 of ‘gtk_style_context_add_provider’ from incompatible pointer type [enabled by default]



How do I make GtkCssProvider* compatible with the GtkStyleProvider* expected by the gtk_style_context_add_provider() function?

Although it is only a warning, and my program still compiles, the font color is unchanged.


Top
 Profile  
 
 Post subject: Re: Using gtk_style_context_add_provider with css
PostPosted: Mon Oct 07, 2013 12:24 am 
Offline
Familiar Face

Joined: Wed Jan 30, 2013 8:28 pm
Posts: 20
uses: GTK_STYLE_PROVIDER(css_provider)


Top
 Profile  
 
 Post subject: Re: Using gtk_style_context_add_provider with css
PostPosted: Mon Oct 07, 2013 4:01 pm 
Offline

Joined: Mon Sep 02, 2013 10:02 pm
Posts: 4
Perfect - many thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group