GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
FAQ
Search
Memberlist
Usergroups
Register
Profile
Log in to check your private messages
Log in
Text View Color
GTK+ Forums Forum Index
->
GTK+ Programming
Author
Message
Dimon-z
Joined: 27 Apr 2008
Posts: 2
Posted: Sun Apr 27, 2008 6:27 pm
Post subject: Text View Color
How to set TextView text color in C
Back to top
Wolfgang
Familiar Face
Joined: 05 Feb 2008
Posts: 37
Posted: Mon Apr 28, 2008 8:19 am
Post subject:
Do you need to change existing text color or to insert new text with specified color?
Back to top
alen121
Familiar Face
Joined: 28 Sep 2007
Posts: 25
Posted: Wed Apr 30, 2008 5:23 am
Post subject:
How we can change the text color written in the textview . I used gtk_widget_modify_fg() function . but the color hasnt changed .
Back to top
Wolfgang
Familiar Face
Joined: 05 Feb 2008
Posts: 37
Posted: Wed Apr 30, 2008 5:29 am
Post subject:
Code:
(C)
1
2
3
4
5
6
7
8
9
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
Back to top
Display posts from previous:
All Posts
1 Day
7 Days
2 Weeks
1 Month
3 Months
6 Months
1 Year
Oldest First
Newest First
GTK+ Forums Forum Index
->
GTK+ Programming
All times are GMT
Page
1
of
1
Powered by
phpBB
© 2001, 2005 phpBB Group
CodeBB
1.0 Beta 2
Protected by
Anti-Spam ACP