GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Nov 01, 2014 7:29 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Text View Color
PostPosted: Sun Apr 27, 2008 6:27 pm 
Offline

Joined: Sun Apr 27, 2008 11:20 am
Posts: 2
How to set TextView text color in C


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 28, 2008 8:19 am 
Offline
GTK+ Guru

Joined: Tue Feb 05, 2008 8:39 am
Posts: 130
Do you need to change existing text color or to insert new text with specified color?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 30, 2008 5:23 am 
Offline
Familiar Face

Joined: Fri Sep 28, 2007 10:59 am
Posts: 46
How we can change the text color written in the textview . I used gtk_widget_modify_fg() function . but the color hasnt changed .


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 30, 2008 5:29 am 
Offline
GTK+ Guru

Joined: Tue Feb 05, 2008 8:39 am
Posts: 130
Code:
void TextColor(GtkWidget *label, long color_)
{
  GdkColor color;
  gchar cname[32];

  g_sprintf(cname, "#%06X", color_);
  gdk_color_parse(cname, &color);
  gtk_widget_modify_text(label,  GTK_STATE_NORMAL, &color);
}

It works for label. Try to call it for GtkTextView


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 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